Sign in to follow this  
gbiondo

Please, help me debugging this one

Recommended Posts

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 by Guest

Share this post


Link to post
Share on other sites

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

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
Sign in to follow this