The following example shows how you can change the start angle in a Flex Pie Chart.
Full code after the jump.
For more information on setting up charting in an Adobe Flex 3 Beta 1 project, see “Charting in Flex Builder 3 (public beta 1 edition)“.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/24/setting-a-flex-pie-charts-start-angle/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
private function degrees_func(item:Number):String {
return item + String.fromCharCode(176);
}
]]>
</mx:Script>
<mx:Array id="dp">
<mx:Object data="3" />
<mx:Object data="1" />
<mx:Object data="4" />
<mx:Object data="1" />
<mx:Object data="5" />
<mx:Object data="9" />
</mx:Array>
<mx:ApplicationControlBar dock="true">
<mx:Label text="startAngle:" />
<mx:HSlider id="slider"
minimum="0"
maximum="360"
liveDragging="true"
snapInterval="1"
tickInterval="10"
showTrackHighlight="true"
dataTipPrecision="0"
dataTipFormatFunction="degrees_func" />
</mx:ApplicationControlBar>
<mx:PieChart id="chart"
height="100%"
width="100%"
dataProvider="{dp}">
<mx:series>
<mx:PieSeries id="pieSeries"
field="data"
startAngle="{slider.value}" />
</mx:series>
</mx:PieChart>
</mx:Application>
View source is enabled in the following example.





Hi,
Thanks for this example.
I use pie chart in my application, is there a way to have a semi pie chart ?
Val
Hi,
Thanks for this example.
I use pie chart in my application, is there a way to have a semi pie chart ?
Val
zeka oyunları,
Does this work for you? “Drawing transparent pie wedges in a Flex PieChart control”?
Peter
can make it a 3D style?
Anonymous,
I don’t believe that the Adobe Flex Charting components do 3D, but there are 3rd party components that offer 3D. For example, check out the ILOG Elixir components at http://www.ilog.com/products/ilogelixir/features/3d-charts/ .
Peter
Does this work for you?