Hi,
I am new to FC, I just downloaded latest trial version. While I am trying to follow an example to change chart attribute on the fly(http://www.fusioncharts.com/docs/JavaScript/JS_ChangeChartProperties.html), but it is not working for me.
Here is my html code(Only thing I change here is location of js and data.xml):
<html>
<head>
<title>Update Chart data</title>
<script type="text/javascript" src="FusionCharts/FusionCharts.js">
</script>
</head>
<body>
<center>
<div id="chartContainer">FusionCharts will load here!</div>
<script type="text/javascript"><!--
var myChart = new FusionCharts( "FusionCharts/Column2D.swf",
"myChartId", "300", "240", "0", "1" );
myChart.setXMLUrl("Data.xml");
myChart.render("chartContainer");
function changeAttribute()
{
// get chart reference
var chartReference = FusionCharts( "myChartId" );
// change palette, palette colors and set glass effect to chart
chartReference.setChartAttribute( { "palette" : "2", paletteColors : "ACBF72", useRoundEdges : 1 } );
}
// -->
</script>
<input type="button" onClick="changeAttribute();" value="Change Chart Theme" >
</center>
</body>
</html>
And Data.xml:
<chart caption="Yearly Sales Summary" numberPrefix="$" xAxisName="Year" yAxisName="Amount">
<set label="2005" value="1735.08" />
<set label="2006" value="1335.08" />
<set label="2007" value="1582.08" />
<set label="2008" value="1555.08" />
</chart>
It renders the chart on first load, but nothing happens after clicking the change button. Please let me know what I am doing wrong.