Sign in to follow this  
ssubram

Set Data XML

Recommended Posts

Hi

First of all, thanks for sharing a great product!

I'm using the following code for setdataxml method. It does not work. Can you please help?

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>RSA Test Chart</title>

<link rel="stylesheet" href="style.css" type="text/css" />

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

</head>

<body>

<p><img src="logo_rsa.gif" width="112" height="58"></p>

<table width="98%" border="0" cellspacing="0" cellpadding="3" align="center">

  <tr>

  <td valign="top" class="text" align="center"> <div id="chartdiv" align="left">

</div>

  <script type="text/javascript">

 

var chart = new FusionCharts("FCF_MSLine.swf", "ChartId", "850", "500");

chart.setDataXml("<graph caption='February Peak Load vs. Today' xAxisName='Hour Ending' yAxisName='Load (MW)' hovercapbg='FFECAA' hovercapborder='F47E00' formatNumberScale='0' decimalPrecision='0' showvalues='0' animation='1' numdivlines='3' numVdivlines='0' yaxisminvalue='1000' yaxismaxvalue='1800' lineThickness='3' rotateNames='1'>

 

<categories>

   <category name='1' />

   <category name='2' />

   <category name='3' />

   <category name='4' />

</categories>

<dataset seriesname='February Peak Load' color='FF8000' showValue='1' alpha='80' showAnchors='0'>

   <set value='1550' />

   <set value='1550' />

   <set value='1550' />

   <set value='1550' />

  </dataset>

 

<dataset seriesname='Current Day 2/3/05' color='0099FF' showValue='1' alpha='100' anchorAlpha='0' lineThickness='2'>

   <set value='1188' />

   <set value='1189' />

 <set value='1177' />

   <set value='1175' />

</dataset>

 </graph>");

 

 

chart.render("chartdiv");

</script> </td>

  </tr>

  <tr>

  <td valign="top" class="text" align="center"> </td>

  </tr>

 

</table>

</body>

</html>

Thanks a lot.

Share this post


Link to post
Share on other sites

Hi,

 
Could you please pass the XML without breaking it into multiple lines, and try again?
 
chart.setDataXml("<graph caption='February Peak Load vs. Today' xAxisName='Hour Ending' yAxisName='Load (MW)' hovercapbg='FFECAA' hovercapborder='F47E00' formatNumberScale='0' decimalPrecision='0' showvalues='0' animation='1' numdivlines='3' numVdivlines='0' yaxisminvalue='1000' yaxismaxvalue='1800' lineThickness='3' rotateNames='1'><categories><category name='1' /><category name='2' /><category name='3' /><category name='4' /></categories><dataset seriesname='February Peak Load' color='FF8000' showValue='1' alpha='80' showAnchors='0'><set value='1550' /><set value='1550' /><set value='1550' /><set value='1550' /></dataset><dataset seriesname='Current Day 2/3/05' color='0099FF' showValue='1' alpha='100' anchorAlpha='0' lineThickness='2'><set value='1188' /><set value='1189' /><set value='1177' /><set value='1175' /></dataset></graph>");

Share this post


Link to post
Share on other sites

Hi

Thanks for your quick reply.

I copied and pasted as below - But it sill still not working!

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>RSA Test Chart</title>

<link rel="stylesheet" href="style.css" type="text/css" />

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

</head>

<body>

<p><img src="logo_rsa.gif" width="112" height="58"></p>

<table width="98%" border="0" cellspacing="0" cellpadding="3" align="center">

  <tr>

  <td valign="top" class="text" align="center"> <div id="chartdiv" align="left">

</div>

  <script type="text/javascript">

 

var chart = new FusionCharts("FCF_MSLine.swf", "ChartId", "850", "500");

chart.setDataXml("<graph caption='February Peak Load vs. Today' xAxisName='Hour Ending' yAxisName='Load (MW)' hovercapbg='FFECAA' hovercapborder='F47E00' formatNumberScale='0' decimalPrecision='0' showvalues='0' animation='1' numdivlines='3' numVdivlines='0' yaxisminvalue='1000' yaxismaxvalue='1800' lineThickness='3' rotateNames='1'><categories><category name='1' /><category name='2' /><category name='3' /><category name='4' /></categories><dataset seriesname='February Peak Load' color='FF8000' showValue='1' alpha='80' showAnchors='0'><set value='1550' /><set value='1550' /><set value='1550' /><set value='1550' /></dataset><dataset seriesname='Current Day 2/3/05' color='0099FF' showValue='1' alpha='100' anchorAlpha='0' lineThickness='2'><set value='1188' /><set value='1189' /><set value='1177' /><set value='1175' /></dataset></graph>");

 

chart.render("chartdiv");

</script> </td>

  </tr>

  <tr>

  <td valign="top" class="text" align="center"> </td>

  </tr>

 

</table>

</body>

</html>

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