日期:2014-05-17 浏览次数:20698 次
<HTML> <HEAD> <TITLE>FusionCharts Free & JavaScript - Updating chart using setDataXML() Method</TITLE> </HEAD> <BODY onload=init()> <div id="chartdiv"> FusionCharts </div> <SCRIPT LANGUAGE="Javascript" SRC="../JSClass/FusionCharts.js"></SCRIPT> <script language="JavaScript"> var chart1 = new FusionCharts("../Charts/FCF_Column3D.swf", "chartid", "400", "300"); function init(){ chart1.setDataXML("<graph><set name='A' value='20' color='D64646' /><set name='B' value='31' color='AFD8F8' /></graph>"); chart1.render("chartdiv"); } function update(){ updateChartXML("chartid","<graph><set name='A' value='40' color='D64646' /></graph>"); } </script> <form name='frmUpdate'> <input type='button' value='change' onClick=update() name='btnUpdate'> </form> </HTML>
xml.append("<set link='javascript:update("+label+")' label='" + label + "' value='" + value + "'/>");