fcuser Report post Posted November 13, 2009 Hi I am trying the following piece of code to generate multiple charts in html in one page. <html> <head> <script language="JavaScript" src="../FusionCharts/FusionCharts.js"></script> </head> <body bgcolor="#ffffff"> <div id="chart1div" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div> <script type="text/javascript"> var myChart1 = new FusionCharts("../FusionCharts/Pie3D.swf", "myChart1Id", "900", "300", "0", "0"); myChart1.setDataURL("Data.xml"); myChart1.render("chart1div"); </script> <div id="chart2div" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div> <script type="text/javascript"> var myChart2 = new FusionCharts("../FusionCharts/Column2D.swf", "myChart1Id", "600", "300", "0", "0"); myChart2.setDataURL("Data.xml"); myChart2.render("chart2div"); </script> </body> </html> I am unable to see the charts. I am not sure what the mistake is. Can you please tell me where I went wrong? Thanks in advance. Share this post Link to post Share on other sites
Guest Madhumita Report post Posted November 13, 2009 Hello, For each chart you have to pass unique IDs. Thus, var myChart2 = new FusionCharts("../FusionCharts/Column2D.swf", "myChart1Id", "600", "300", "0", "0"); would be, var myChart2 = new FusionCharts("../FusionCharts/Column2D.swf", "myChart2Id", "600", "300", "0", "0"); You had specified the same ID myChart1Id for both the charts. That is why the charts were not showing. Hope this helps. Share this post Link to post Share on other sites
fcuser Report post Posted November 13, 2009 Thanks for the quick response. So, Unique Id has to be given for each chart in the page. It Worked ! Share this post Link to post Share on other sites
Guest Madhumita Report post Posted November 13, 2009 Hello, You are most welcome. Its great to know that the charts are being displayed. Happy FusionCharting. Share this post Link to post Share on other sites