LineChart
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
protected var arr:ArrayCollection = new ArrayCollection(
[{xm:'張三',yw:80,sx:90,yy:88},{xm:'李四',yw:70,sx:80,yy:68},{xm:'王五',yw:70,sx:60,yy:98}]
);
]]>
</fx:Script>
<mx:LineChart id="linechart1" x="439" y="56" width="354" height="367" dataProvider="{arr}" showDataTips="true">
<mx:series>
<mx:LineSeries displayName="語文" yField="yw"/>
<mx:LineSeries displayName="數學" yField="sx"/>
<mx:LineSeries displayName="英語" yField="yy"/>
</mx:series>
<mx:horizontalAxis>
<mx:CategoryAxis id="xAxis" categoryField="xm">
</mx:CategoryAxis>
</mx:horizontalAxis>
</mx:LineChart>
<mx:Legend x="443" y="433" dataProvider="{linechart1}"/>
ViewStack控制元件
//一種方法
var url:String;
url = "http://www.baidu.com";
ExternalInterface.call("function(){window.location.href='"+url+"'}");
//另一種跳轉方法
var req:URLRequest = new URLRequest(url);
navigateToURL(req,"_blank");
PieChart控制元件
protected function showMoreInfo(data:Object,field:String,index:Number,percentValue:Number):String
{
return data.xm+"\n語文:"+data.yw+"\n數學:"+data.sx+"\n英語:"+data.yy;
}
<mx:PieChart id="piechart1" x="441" y="253" width="294" height="238" dataProvider="{arr}" showDataTips="true">
<mx:series>
<mx:PieSeries displayName="語文" field="yw" labelFunction="showMoreInfo" labelPosition="callout" />
</mx:series>
</mx:PieChart>
<mx:Legend x="438" y="491" dataProvider="{piechart1}"/>