Getting java script error “chartId is undefined”
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Getting java script error “chartId is... Expand / Collapse
Author
Message
Posted 11/1/2007 5:47:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/2/2007 7:08:40 AM
Posts: 2, Visits: 3

Hi,

I am using "Multi series 2D Combination Fusion Chart, JSP & Java script (dataXML) method".

When I am using fusion chart in java script like that

 

var myChart = new FusionCharts(“http://localhost:7001/mywebapp/charts/MSCombi2D.swf", "chartId", "750", “250”, "0", "1") ;

myChart.setDataXML(xml) ;

myChart.render("chartdiv") ;


It’s giving me java script error

 chartId is undefined 



My JSP code is:

 <div id="chartdiv" align="center"></div> 


And java script method is:

 

function drawChart()

{          

    var xml = createXmlStringForChart() ;

           

    var myChart = new FusionCharts(“http://localhost:7001/mywebapp/charts/MSCombi2D.swf", "chartId", "750", “250”, "0", "1") ;

    myChart.setDataXML(xml) ;

    myChart.render("chartdiv") ;

}

 


drawChart() method called after loading of page.

Its draw chart properly but give java script error in render method.


Can you help me in removing that java script error?


Thanks & Regards

Post #2920
Posted 11/1/2007 9:06:44 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 5:38:52 AM
Posts: 884, Visits: 1,420
Hi,

May be u are using the DIV inside FORM. IF that is the case please use this line of code afer render()

//Please replace the value of Id with your chart ID :

var Id="chartId";
if(!document.embeds[Id])
      window[chartId]=document.getElementById(Id);

Regards,

Sudipto Choudhury
FusionCharts Team

Post #2923
Posted 11/2/2007 7:11:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/2/2007 7:08:40 AM
Posts: 2, Visits: 3

Thanks Sudipto,

 

Its working as I want.

Thanks & Regards

Post #2948
Posted 11/2/2007 9:23:03 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 5:38:52 AM
Posts: 884, Visits: 1,420
Our pleasure

Regards,

Sudipto Choudhury
FusionCharts Team
Post #2953
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 6:29pm


Execution: 0.063.