网上说--->
如果在图表显示之后,需要变更图表类型,笔者查看了uxfusion.js,没有发现类似setChartUrl功能的函数,通过摸索,可以自行增加类似函数,实现动态变更图表类型的:
代码(uxfusion.js中增加):
setChartData : function(xml, immediate){
var o;
this.chartData = xml;
this.dataURL = null;
if( immediate !== false && (o = this.getInterface())){
if( 'setDataXML' in o ){
o.setDataXML(xml);
} else { //FC Free Interface
this.setVariable("_root.dataURL","");
//Set the flag
this.setVariable("_root.isNewData","1");
//Set the actual data
this.setVariable("_root.newData",xml);
//Go to the required frame
if('TGotoLabel' in o){
o.TGotoLabel("/", "JavaScriptHandler");
}
}
}
o = null;
return this;
},
setChartUrl : function(Url){ //增加变更图表类型的函数,哈哈简单吧
this.chartURL = Url;
this.refreshMedia();
},...
使用方法就很简单了,举例:
{
text:'饼形',
handler:function(){fusionPanel.setChartUrl('charts/Pie3D.swf');}
}我调试不通过。有谁有这样的经验?
如果在图表显示之后,需要变更图表类型,笔者查看了uxfusion.js,没有发现类似setChartUrl功能的函数,通过摸索,可以自行增加类似函数,实现动态变更图表类型的:
代码(uxfusion.js中增加):
setChartData : function(xml, immediate){
var o;
this.chartData = xml;
this.dataURL = null;
if( immediate !== false && (o = this.getInterface())){
if( 'setDataXML' in o ){
o.setDataXML(xml);
} else { //FC Free Interface
this.setVariable("_root.dataURL","");
//Set the flag
this.setVariable("_root.isNewData","1");
//Set the actual data
this.setVariable("_root.newData",xml);
//Go to the required frame
if('TGotoLabel' in o){
o.TGotoLabel("/", "JavaScriptHandler");
}
}
}
o = null;
return this;
},
setChartUrl : function(Url){ //增加变更图表类型的函数,哈哈简单吧
this.chartURL = Url;
this.refreshMedia();
},...
使用方法就很简单了,举例:
{
text:'饼形',
handler:function(){fusionPanel.setChartUrl('charts/Pie3D.swf');}
}我调试不通过。有谁有这样的经验?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货