FusionCharts Forum: Problem with being able to use multipe onclick functions - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem with being able to use multipe onclick functions

#1 User is offline   disco24 

  • Forum Newbie
  • Group: Members
  • Posts: 2
  • Joined: 18-August 09

Posted 18 August 2009 - 01:15 PM

Hello,

I just found and started using Fusion Charts, so far I'm really liking what it can do. I'm new to this so please bare with me.

I do have a problem though. I can't seem to be able to use different onclick functions on the page that I've created.

The page has multiple links and when you click on one of them two separate SWF's open and show the appropriate data. This is working fine but I can't seem to be able to click on any of the other links to display there SWF"s. If I refresh the page and then click on the link it works for that one.

I've create two seperate XML files that it uses (ex: adus10_pie.xml and adus10_chart.xml)

Any help would be greatly appreciated. I will include what I have so far.

<html>
<head>
<script language="JavaScript" src="/fusioncharts/fusioncharts/FusionCharts.js"></script>

<title>testing</title>
<style type="text/css">
<!--
.style2 {color: #FFFFFF; font-size: 18px; }
.style4 {color: #000000}
.style5 {color: #FFFFFF}
-->
</style>

<script>
function showgraphs (servers){
mypie.setDataURL(servers+"_pie.xml");
  mypie.render("piediv");
mychart.setDataURL(servers+"_chart.xml");
  mychart.render("chartdiv");
}
</script>

</head>

<body>

<div align="center">
  <table width="100%" height="75%" border="3" cellpadding="2" cellspacing="1">
  <tr>
  <td width="15%" bgcolor="#7AC142"><p align="center">&nbsp;</p>
  <p align="center">&nbsp;</p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('adus10');">adus10</a> </p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('adcan6');">adcan6</a> </p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('impact2');">impact2</a> </p>

  <td width="15%" bgcolor="#7AC142"><p align="center" class="style4">Click on any link to view the disk usage and the size of the home directories </p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('lgbhalo2');">lgbhalo2</a> </p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('adesa');">adesa</a> </p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('adcan4');">adcan4</a> </p>
 
  <p align="center" class="style2"><a href="#" onclick="showgraphs('halo1');">halo1</a> </p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('halo2');">halo2</a> </p>
  <p align="center" class="style2"><a href="#" onclick="showgraphs('halo1');">halo1</a> </p>

</td>
</div>

<td width="67%" bgcolor="#CCCCCC"><div align="center">

<div id=piediv> </div>
<script type="text/javascript">
  var mypie = new FusionCharts("/fusioncharts/fusioncharts/FCF_Pie3D.swf", "pieId", "400", "400");
  mypie.setDataURL(servers+"_pie.xml");
  mypie.render("piediv");
  </script>
 
</div>
</td>
  </tr>
  </table>
 
  <table width="100%" height="80%" border="3" cellpadding="2" cellspacing="1">
  <tr>
  <td height="60%" bgcolor="#32AFE1"><div align="center">

<div id=chartdiv> </div>
<script type="text/javascript">
  var mychart = new FusionCharts("/fusioncharts/fusioncharts/FCF_Column3D.swf", "chartId", "1400", "550");
  mychart.setDataURL(servers+"_chart.xml");
  mychart.render("chartdiv");
  </script>

</div>
</td>
  </tr>
  </table>
</div>

</body>
</html>

0

Other Replies To This Topic

#2 User is offline   Rajroop 

  • FusionCharts Team
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1803
  • Joined: 19-May 09

Posted 19 August 2009 - 09:36 AM

Hi,

You would also need to reinitilaize the charts objects again before rendering the chart in showgraphs() functions.

var mypie = new FusionCharts("/fusioncharts/fusioncharts/FCF_Pie3D.swf", "pieId", "400", "400");
 

Regards,

Rajroop Bhaduri

FusionCharts Team

Help us improve our documentation with your precious feedback at:
http://documentation...sioncharts.com/

Follow us @Twitter
0

Other Replies To This Topic

#3 User is offline   disco24 

  • Forum Newbie
  • Group: Members
  • Posts: 2
  • Joined: 18-August 09

Posted 19 August 2009 - 10:07 AM

Quote

Rajroop (8/19/2009)
Hi,You would also need to reinitilaize the charts objects again before rendering the chart in showgraphs() functions.

var mypie = new FusionCharts("/fusioncharts/fusioncharts/FCF_Pie3D.swf", "pieId", "400", "400");
 

Thank you for your help.

This fixed it and everything is working perfect.

Thank you again.

0

Other Replies To This Topic

#4 User is offline   Sudipto Choudhury 

  • Supreme Being
  • Group: Administrators
  • Posts: 1886
  • Joined: 19-March 07

Posted 20 August 2009 - 05:35 PM

:w00t::)
Regards,

Sudipto Choudhury
FusionCharts Team

Follow us on Twitter

I code, therefore I am.

0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic