The PieChart Control is a MX Component. There is no Spark component.
The PieChart Control is a MX Component. There is no Spark component.The PieChart Control is a MX Component. There is no Spark component. The PieChart Control is a circular chart in which the wedges represent to the data value. You can provide the data to the chart control by using data provider property. You will use the PieSeries Class for creating a pie series. You will use Field, labelPosition, nameField property for Pieseries. You can set the label position by using labelposition property. You can provide the space between each wedges by using explodeRadius property. You can set the color by using <mx:SolidColor>. The tag of PieChart Control is <mx:PieChart>.
|
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s=" library://ns.adobe.com/flex/spark"xmlns:mx=" library://ns.adobe.com/flex/mx"minWidth=" 955" minHeight="600" height="734"><![CDATA[ [ Bindable] private var chartData:ArrayCollection = new ArrayCollection( [{country: "Czech Republic",litres:156.90},{country: "India",litres:200.90},{country: "Ireland",litres:131.10},{country: "Germany",litres:115.80},{country: "Australia",litres:109.90},{country: "Austria",litres:125.30},{country: "UK",litres:99.00},{country: "Belgium",litres:40.00}]); private function displaylitres(data:Object, field:String,index:Number, percentValue:Number):String { var temp:String= (" " + percentValue).substr(0,6); return
data.country + ": "
+ '\n'
+ "Litres: "
+ data.litres + '\n'
+ temp + "%"; } ps.explodeRadius=.05; } ]]> </fx:Script> dataProvider=" {chartData}"showDataTips=" true"width=" 564" height="412"innerRadius=" .3" click="clickHandler()">field=" litres"nameField=" country"displayName=" country"labelPosition=" callout"labelFunction=" displaylitres"filters=" []"fills=" {[sc1, sc2, sc3, sc4, sc5, sc6, sc7, sc8]}"/></s:Application> |
To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.