1.fusionCharts 从后台获取数据可以保存在xml文件中,也可以直接加载在页面中。
(1)直接加载在页面中:
<script language="JavaScript" src="FusionCharts.js"></script>
<div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div>
<script type="text/javascript">
var myChart = new FusionCharts("Column3D.swf", "myChartId", "900", "300", "0", "0");
var xmls=
"<chart caption='产品' xAxisName='名称' yAxisName='价格' showValues='0' decimals='0' formatNumberScale='0'>"+
"<set label='冬瓜' value='2.0000'/>"+
"<set label='香蕉' value='20.0000'/>"+
"<set label='葡萄' value='20.0000'/>"+
"<set label='纯净水' value='20.0000'/>"+
"<set label='苹果' value='12.0000'/>"+
"<set label='啤酒' value='10.0000'/>"+
"<set label='牙刷' value='6.5000'/>"+
"<set label='牙膏' value='12.0000'/>"+
"<set label='茶叶' value='100.0000'/>"+
"<set label='茶杯' value='34.0000'/>"+
"<set label='基拉' value='43.0000'/>"+
"<set label='牛奶' value='90.0000'/>"+
"</chart>";
myChart.setDataXML(xmls);
myChart.render("chartdiv");
</script>
(2)从xml中加载数据,尚未实现