- JScript code
function init2(){ setInterval("showChart()", 2000); } FusionCharts.setCurrentRenderer('JavaScript'); var myChart = new FusionCharts("Charts/MSLine.swf", 'chart',"298", "200", "0", "1"); function showChart(){ var fData="<chart palette='2' bgColor='#C6B9AA' lineThickness='0.5' borderThickness='0' AlternateHGridColor='C6B9AA,C6B9AA' bgBgAlpha='100' caption=' ' animation='0' canvasBorderThickness='0' showValues='0' yAxisMaxValue='100' yAxisMinValue='0' numVDivLines='0' drawAnchors='0' ><categories><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /><category label='' /></categories><dataset seriesName='电信' color='FF0000' anchorBorderColor='0080C0' ><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /><set value='40' /></dataset><dataset seriesName='移动' color='FF00FF' anchorBorderColor='008040'><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /><set value='25' /></dataset><dataset seriesName='联通' color='3333FF' anchorBorderColor='808080'><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /><set value='20' /></dataset></chart>"; myChart.setXMLData(fData); myChart.render("fuzai"); }
内存在不断增加
------解决方案--------------------
- JScript code
function init2(){ setInterval("showChart()", 2000); }//这个方法每隔两秒执行一次showChart()方法。 var fData="<chart palette='2' ...//每次都定义一个fData,内存必然会增加了。
------解决方案--------------------
解决了没,我也遇到同样问题!!! 麻烦楼主回下
------解决方案--------------------
每次调用showChart 都会新建一个 fData ,可以把 showChart放在函数外面,作为全局的,另外可以使用 CollectGarbage,上网搜搜吧