fusioncharts图表切换、多次重新加载——dispose

前段时间同一个页面fusioncharts图表切换一直没出问题,如下图:


最近运行系统突然报错:

Uncaught ParameterException: #06091847 chartobject-1 Warning >> A FusionChart oject with the specified id "theTaskRateChart" already exists. Renaming it to chartobject-1


dispose方法完美解决文件,如下:

if(FusionCharts("theChart")){
			//dispose掉
			FusionCharts("theChart").dispose();
			//然后再重新new一个FusionCharts
			taskRateChart = new FusionCharts(path + "/js/common/fusionchart/swf/StackedColumn3DLineDY.swf", "theChartID", "100%", "100%", "0", "0");
		}
,原文:
http://forum.fusioncharts.com/topic/8468-a-fusionchart-oject-with-the-specified-id-mychartid-already-exists/


附带:fusioncharts加载完成的监听事件
taskRateChart.addEventListener("Rendered",function(evt,args){
				alert(evt.sender.id+"-OK");
			});


你可能感兴趣的:(fusioncharts图表切换、多次重新加载——dispose)