Sunday, 4 March 2012

Simple Charts(pie chart)


<?xml version="1.0"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script><![CDATA[
     import mx.collections.ArrayCollection;
     [Bindable]
     public var arr:ArrayCollection = new ArrayCollection([
        {Food:"Burger", Price:50},
        {Food:"samosa", Price:10},
        {Food:"juice", Price:100},
        {Food:"pakore", Price:45},
        {Food:"icecream", Price:100},
        {Food:"coldrink", Price:25}
     ]);
  ]]></mx:Script>
  <mx:Panel title="Food Pie Chart">
     <mx:PieChart id="PieChart"
        dataProvider="{arr}"
        showDataTips="true"
     >
        <mx:series>
           <mx:PieSeries
                field="Price"
                nameField="Food"
                labelPosition="callout"
           />
        </mx:series>
     </mx:PieChart>
     <mx:Legend dataProvider="{PieChart}"/>
  </mx:Panel>
</mx:Application>

2 comments:

  1. Sir plz tell me about exploding pie chart.

    ReplyDelete
  2. dear vishnu,
    sorry for replying late, i have posted code for exploding pie chart.

    ReplyDelete