gbiondo Report post Posted April 15, 2008 (edited) Hi all I have the need to render several XML files describing line charts in the same page. chiefly, I wrote this routine, that should - at some point - generate this HTML: [script type=text/javascript] var [?="chart$i"?] = new FusionCharts("Charts/FCF_MSLine.swf", "ChartId", "600", "350"); [?="chart$i"?].setDataURL("[?=$f?]"); [?="chart$i"?].render("chartdiv"); [/script] [/td] where [ must be read as the less-than symbol and ] as the greater-than. $i is a counter - used to serialize the javascript objects, and $f is the current XML file path. Unfortunately, only the last graph is shown. Can you please help me? Thanks in advance. Edited April 15, 2008 by Guest Share this post Link to post Share on other sites
Arindam Report post Posted April 16, 2008 Hi gbiondo, In multiple FusionCharts, Render Charts need different <div> and different chart id. Please modify your code as per given code. <? for($i=1;$i<11;$i++){ ?> <div id="<?="chart$i"?>div"></div> <script type="text/javascript"> var <?="chart$i"?> = new FusionCharts("Charts/FCF_MSLine.swf", "<?="chart$i"?>", "600", "350"); <?="chart$i"?>.setDataURL("<?=$f?>"); <?="chart$i"?>.render("<?="chart$i"?>div"); </script> <? } ?> Share this post Link to post Share on other sites