reefree

#25081843:iecompatibility() Chart Id Is Same As A Javascript Variable Name. Variable Naming Error. Please Use Unique Name For Chart Js Variable, Char

Recommended Posts

#25081843:IECompatibility() Chart Id is same as a JavaScript variable name. Variable naming error. Please use unique name for chart JS variable, chart-id and container id.

 

 

hi~

 

hello~

 

nice to meet you~*^^*

 

 

 

please help...

 

 

i'm korean Programmer

 

 

ie 7, ie 9 No problem

 

ie 8 error ;;

 

 

please help..

 

 

 

 

source..

 

 

 

 

 

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...ransitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">

<head>

<title>워크넷</title>

 

<meta name="selected-menu" content="0,0,0" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="imagetoolbar" content="no" />

<meta name="robots" content="index,follow" />

<meta name="subject" content="#" />

<meta name="author" content="#" />

<meta name="keywords" content="#" />

 

 

 

<meta http-equiv="X-UA-Compatible" content="IE=7;" />

 

<link rel="stylesheet" href="/css/default.css" type="text/css" />

<link rel="stylesheet" href="/css/popup.css" type="text/css" />

<link rel="stylesheet" href="/css/board.css" type="text/css" />

<script type="text/javascript" src="/js/framework/keis.import.js" charset='utf-8'></script>

<script type="text/javascript" src="/js/worknet.common.js" charset='utf-8'></script>

<script type="text/javascript" src="/js/worknet.popup.js" charset='utf-8'></script>

<script type="text/javascript" src="/js/worknet.indivMemberSrv.js" charset='utf-8'></script>

<script type="text/javascript" src="/js/worknet.member.js" charset='utf-8'></script>

 

<script>

//<![CDATA[

//json 형태의 object debugging func(홍세기 [email protected])

function viewProp() {

var allHtml = "";

 

for (var x = 0 ; x < arguments.length ; x++) {

var obj = arguments[x];

 

var names = "<table border='1' cellspacing='1' cellpadding='1'><tr>";

if (obj.toString().substr(0,8) === '[object ') {

names += "<td>name</td><td>value</td></tr>";

var arr = new Array();

for (var name in obj) {

arr.push(name);

}

arr.sort();

for (var i = 0 ; i < arr.length ; i++) {

var key = arr;

names += "<tr><td>";

names += key;

names +='</td><td>' ;

names += obj[key];

names += '</td></tr>';

}

names += "</table>";

arr = null;

} else {

names += "<td>value</td></tr>";

names += "<tr><td>";

names += obj;

names += '</td></tr>';

}

allHtml += names + "<br/>";

}

 

var pop = window.open("", "viewProperty", "", "");

pop.focus();

pop.document.body.innerHTML = allHtml.fixed();

 

}

//]]>

</script>

</head>

<body id="popup">

<div id="wrapper">

<h1>입사지원현황통계 <span>로고</span></h1>

<h2>입사지원현황통계 <strong>(지원자수:1명)</strong></h2>

<div class="stats_wrap">

<div class="statsl">

<h3 class="sh4">성별 지원분포</h3>

<div id="sexual-1" class="stats_box">

<span id="sexual"></span>

<div class="two">

<p><strong>1</strong>명/100%</p>

<p><strong>0</strong>명/0%</p>

</div>

</div>

 

<h3 class="sh4">학력별 지원분포</h3>

<div id="school-1" class="stats_box">

<span id="school"></span>

<div>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>1</strong>명/100%</p>

<p><strong>0</strong>명/0%</p>

</div>

</div>

 

<h3 class="sh4">경력별 지원분포</h3>

<div id="career-1" class="stats_box">

<span id="career"></span>

<div class="six">

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>1</strong>명/100%</p>

</div>

</div>

</div>

 

<div class="statsr">

<h3 class="sh4">연령별 지원분포</h3>

<div id="age-1" class="stats_box">

<span id="age"></span>

<div>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>1</strong>명/100%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

</div>

</div>

 

<h3 class="sh4">희망연봉별 지원분포</h3>

<div id="hopeSal-1" class="stats_box">

<span id="hopeSal"></span>

<div>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>0</strong>명/0%</p>

<p><strong>1</strong>명/100%</p>

</div>

</div>

</div>

</div>

<div class="btn">

<a href="#1" onclick="window.close();"><img src="/images/common/btn/btn_closed.gif" alt="닫기" /></a>

</div>

 

<script type="text/javascript" src="/ext/fusionCharts/FusionCharts.js"></script>

<script>

//<![CDATA[

// 성별

var sexualJSON = {

"chart" : {

"xAxisName" : "",

"yAxisName" : "",

"showyaxisvalues": "0",

"yAxisMaxValue": 100

},

"data" : [

{ "label" : "남", "value" : "100" },

{ "label" : "여", "value" : "0" }

]

};

 

// 학력별

var schoolJSON = {

"chart" : {

"xAxisName" : "",

"showyaxisvalues": "0",

"yAxisMaxValue": 100

},

"data" : [

{ "label" : "중졸이하", "value" : "0" },

{ "label" : "고졸", "value" : "0" },

{ "label" : "초대졸", "value" : "0" },

{ "label" : "대졸", "value" : "100" },

{ "label" : "석박사", "value" : "0" }

]

};

 

// 경력별

var careerJSON = {

"chart" : {

"xAxisName" : "",

"showyaxisvalues": "0",

"yAxisMaxValue": 100

},

"data" : [

{ "label" : "신입", "value" : "0" },

{ "label" : "1년미만", "value" : "0" },

{ "label" : "1~3년", "value" : "0" },

{ "label" : "3~5년", "value" : "0" },

{ "label" : "5~10년", "value" : "0" },

{ "label" : "10년이상", "value" : "100" }

]

};

 

// 연령별

var ageJSON = {

"chart" : {

"xAxisName" : "",

"showyaxisvalues": "0",

"yAxisMaxValue": 100

},

"data" : [

{ "label" : "20세 이하", "value" : "0" },

{ "label" : "21~25세", "value" : "0" },

{ "label" : "26~30세", "value" : "0" },

{ "label" : "31~35세", "value" : "100" },

{ "label" : "36~40세", "value" : "0" },

{ "label" : "41~45세", "value" : "0" },

{ "label" : "46~50세", "value" : "0" },

{ "label" : "51세이상", "value" : "0" }

]

};

 

// 희망연봉별

var hopeSalJSON = {

"chart" : {

"xAxisName" : "",

"showyaxisvalues": "0",

"yAxisMaxValue": 100

},

"data" : [

{ "label" : "1400미만", "value" : "0"},

{ "label" : "1400~1800", "value" : "0"},

{ "label" : "1801~2200", "value" : "0"},

{ "label" : "2201~2600", "value" : "0"},

{ "label" : "2601~3000", "value" : "0"},

{ "label" : "3001~3400", "value" : "0"},

{ "label" : "3401~4000", "value" : "0"},

{ "label" : "4000", "value" : "100"}

]

};

 

// 챠트 객체 생성

var sexualChart = new FusionCharts("/ext/fusionCharts/Bar2D.swf", "sexualChart", "290", "100", "0", "1" ); // 성별

var schoolChart = new FusionCharts("/ext/fusionCharts/Bar2D.swf", "schoolChart", "290", "160", "0", "1" ); // 학력

var careerChart = new FusionCharts("/ext/fusionCharts/Bar2D.swf", "careerChart", "290", "180", "0", "1" ); // 경력

var ageChart = new FusionCharts("/ext/fusionCharts/Bar2D.swf", "ageChart", "290", "240", "0", "1" ); // 연령

var hopeSalChart = new FusionCharts("/ext/fusionCharts/Bar2D.swf", "hopeSalChart", "290", "240", "0", "1" ); // 희망연봉

 

// 각 챠트 데이터 생성

sexualChart.setJSONData (sexualJSON );

schoolChart.setJSONData (schoolJSON );

careerChart.setJSONData (careerJSON );

ageChart.setJSONData (ageJSON );

hopeSalChart.setJSONData(hopeSalJSON);

 

// 챠트 랜더링

sexualChart.render ("sexual" );

schoolChart.render ("school" );

careerChart.render ("career" );

ageChart.render ("age" );

hopeSalChart.render("hopeSal");

//]]>

</script>

</div>

</body>

</html>

 

 

 

 

 

 

 

PS : There is no redundancy any entry ID

 

 

have a nice day

Edited by reefree

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

Welcome to the FusionCharts Forum smile.gif

 

Thank you for the post and interest in FusionCharts.

 

With regards to your issue, can you please ensure that the path to the *.swf file is correct ?

 

Also, can you please try defining different variable name ?

 

Ref. Code

var sexualChartVariable = new FusionCharts("/ext/fusionCharts/Bar2D.swf", "sexualChart", "290", "100", "0", "1" ); // Please note that the variable name 'sexualChartVariable' is different from the chart reference 'sexualChart'.

 

 

This difference is required to resolve the IE compatibility issue.

 

Hope this helps !!

 

Happy FusionCharting biggrin.gif

Edited by Bindhu

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

We are glad to know that your issue has been resolved :)

 

You are always welcome :D

 

Happy FusionCharting :D

Share this post


Link to post
Share on other sites

Hello,

 

I am having the same issue, but on all IE versions (currently IE 9 in standards mode). However, I have ensured that I am not using the same ID than the variable name, the code looks like:

 

<div id="chartdiv1"> </div>
<script>
var myChart1 = new FusionCharts("Pie3D.swf", "myChartId1", "500" , "300","0","1");
myChart1.render("chartdiv1")
</script>

 

I'm kind of puzzled because according to your explanation, the problem should be fixed. I have also verified with Firebug that myChart1 is undefined and myChartId1 does not exist right before the chart is created.

 

Any clue?

 

Thanks for your help

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

Could you please confirm the FusionCharts version you are using?

 

Awaiting for your response.

Share this post


Link to post
Share on other sites

Hello,

 

It's 3.2.0.

 

Thanks,

 

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

Could you please confirm the FusionCharts version you are using?

 

Awaiting for your response.

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

Could you please upgrade to latest version of FusionCharts i.e FusionCharts XT Service Release 1 (v3.2.2.) from: http://www.fusioncha...ownload/trials/ and see if this helps?

 

All the features of FusionCharts XT (v3.2.2) are backward compatible with FusionCharts v3.1. Hence, upgrading is as easy as copy-pasting files. Listed below are the things that you would need to take care of while upgrading:

 

Copy all chart SWF files from Download Pack > Charts folder and replace your existing chart SWF files in your deployed folder.

 

Copy the new FusionCharts.js from Download Pack > Charts folder and over-write the existing FusionCharts.js in your deployed application folder.

 

v3.2.2 (XT) pack contains 2 new JavaScript files, FusionCharts.HC.js, FusionCharts.HC.Charts.js along with FusionCharts.js and jquery.min.js, which you need to copy to the same folder as FusionCharts.js.

 

Clear your browser cache (very important step).

 

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now