Exploding all wedges in a Flex PieChart control using the explodeRadius property
The following example shows how you can explode all wedges in a PieChart at once by using the If you want to explode individual wedges, simply use the perWedgeExplodeRadius property. explodeRadius
property, as seen in the following snippet:
<mx:PieChart dataProvider="{dp.product}" height="100%" width="100%">
<mx:series>
<mx:PieSeries field="@data" labelPosition="callout">
<mx:explodeRadius>0.2</mx:explodeRadius>
<mx:filters>
<mx:Array />
</mx:filters>
</mx:PieSeries>
</mx:series>
</mx:PieChart>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.events.SliderEvent;
private function setExplodeRadius(evt:SliderEvent):void {
pieSeries.explodeRadius = evt.value;
}
]]>
</mx:Script>
<mx:XML id="dp">
<products>
<product label="Product 1" data="3" />
<product label="Product 2" data="1" />
<product label="Product 3" data="4" />
<product label="Product 4" data="1" />
<product label="Product 5" data="5" />
<product label="Product 6" data="9" />
</products>
</mx:XML>
<mx:ApplicationControlBar dock="true">
<mx:Form styleName="plain">
<mx:FormItem label="explodeRadius:">
<mx:HSlider id="slider"
minimum="0.0"
maximum="0.8"
value="0.2"
liveDragging="true"
showTrackHighlight="true"
snapInterval="0.1"
tickInterval="0.1"
change="setExplodeRadius(event);" />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:PieChart id="pieChart"
dataProvider="{dp.product}"
height="100%"
width="100%">
<mx:series>
<mx:PieSeries id="pieSeries"
field="@data"
labelPosition="callout">
<mx:explodeRadius>0.2</mx:explodeRadius>
<mx:filters>
<mx:Array />
</mx:filters>
</mx:PieSeries>
</mx:series>
</mx:PieChart>
</mx:Application>
10:53 AM
|
Labels:
Flex Controls Samples,
Flex with Chart Examples
|
This entry was posted on 10:53 AM
and is filed under
Flex Controls Samples
,
Flex with Chart Examples
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
0 comments:
Post a Comment