日期:2014-05-20  浏览次数:20803 次

关于AMCharts在Flex下的破解
网上盛传的Txt的Key好像在Flex项目中没用,有人博客提到,
需要继承AmChart的类,将宽、高、透明度设成0,例如:

public class Serial extends AmSerialChart
 {
  override protected function createChildren():void{
   super.createChildren();
   if(_amchartsLink){
    _amchartsLink.alpha=0;
    _amchartsLink.width=0;
    _amchartsLink.height=0;
   }
   return;
  }

}

不过这样就不能用标签声明的方法使用AmCharts了,必须用代码生成~

但是具体怎么继承,怎么用代码生成 ,有哪位老鸟指点一下~
------解决方案--------------------

正常标签使用即可,amchats1的即为你自定义的amcharts
<amcharts1:LineChartFx id="linechart2" width="100%" height="100%" depth="10"
   categoryField="xStrings"
   creationComplete="linechart2_creationCompleteHandler(event)" 
   dataProvider="{getMonthETL2Result2.lastResult}" 
   buttonMode="true"
   startDuration="1.5" >
<amcharts1:graphs>
<amcharts:AmGraph title="yStrings" valueField="yStrings" type="smoothedLine"  
  bullet="round" hideBulletsCount="30"  balloonText="[[xStrings]]: [[value]]"
  />

</amcharts1:graphs>

<amcharts1:valueAxes>
<amcharts:ValueAxis id="v5" axisColor="#FF6600" axisThickness="2"/>                    
</amcharts1:valueAxes>
<amcharts1:categoryAxis>
<amcharts:CategoryAxis gridPosition="start" dashLength="5" />
</amcharts1:categoryAxis>
</amcharts1:LineChartFx>
------解决方案--------------------
遇到同样的问题。。。有人解答下吗。。。
------解决方案--------------------
谢谢1楼的回复。帮助我解决了问题。