SeriesSlide effect for Pie chart : Pie Chart « Chart « Flex






SeriesSlide effect for Pie chart

SeriesSlide effect for Pie chart
      

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
 creationComplete="initApp()" backgroundColor="#FFFFFF">
  <mx:Script>
    
    import mx.charts.events.ChartItemEvent;
    import mx.collections.ArrayCollection;
    import mx.charts.HitData;
    
    [Bindable]
    private var productSales:ArrayCollection;
 
     public function myListener(e:ChartItemEvent):void {
       var pieData:ArrayCollection = new ArrayCollection( [
         {Product: "PC", Total: e.hitData.item.PC},
         {Product: "Mac", Total: e.hitData.item.Mac},
         {Product: "Gadgets", Total: e.hitData.item.Gadgets},
        ]);
       pieChart.dataProvider=pieData;
     }
 
    private function initApp():void{
      productSales = new ArrayCollection( [
            { Quarter: "1", PC: 10000, Mac: 3000, Gadgets: 1000, Total: 14000 },
            { Quarter: "2", PC: 12000, Mac: 4000, Gadgets: 2000, Total: 18000 },
            { Quarter: "3", PC: 15000, Mac: 8000, Gadgets: 5000, Total: 28000 },
            { Quarter: "4", PC: 20000, Mac: 10000, Gadgets: 9000, Total: 39000 }
            ]);
      
      
      columnChart.addEventListener(ChartItemEvent.ITEM_CLICK,myListener);
    }
            
    public function display(data:Object, field:String, index:Number,percentValue:Number):String {
      return data.Product + ": " + data.Total;
    }
  
  </mx:Script>
    
  <mx:SeriesSlide id="showPieEffect" duration="1000"/>
  <mx:Panel title="Effects" width="100%" height="100%">
    <mx:ColumnChart id="columnChart" height="100%" width="100%" showDataTips="true" dataProvider="{productSales}">
      <mx:horizontalAxis>
        <mx:CategoryAxis categoryField="Quarter"/>
      </mx:horizontalAxis>          
      <mx:series>
        <mx:ColumnSeries xField="Quarter" yField="Total" displayName="Quarter"/>
      </mx:series>
    </mx:ColumnChart>
    <mx:PieChart id="pieChart" height="100%" width="100%" showDataTips="true">
      <mx:series>
        <mx:PieSeries showDataEffect="{showPieEffect}" labelPosition="callout" field="Total" labelFunction="display"/>
      </mx:series>
    </mx:PieChart>
  </mx:Panel>
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Pie chart with two seriesPie chart with two series
2.Pie Chart DemoPie Chart Demo
3.Create a pie chartCreate a pie chart
4.Set horizonta lAxis and Area Series for Pie ChartSet horizonta lAxis and Area Series for Pie Chart
5.Add a second tag to display two data series for Pie ChartAdd a second <mx:AreaSeries> tag to display two data series for Pie Chart
6.To explode all wedges of a pie chart evenly, you use the explodeRadius property on the PieSeriesTo explode all wedges of a pie chart evenly, you use the explodeRadius property on the PieSeries
7.Pie chart inner radiusPie chart inner radius
8.The following example defines a PieChart control:The following example defines a PieChart control:
9.To create a doughnut chart, specify the innerRadius property on the PieChart controlTo create a doughnut chart, specify the innerRadius property on the PieChart control
10.creates a PieChart that uses only red, white, and blue colors for the wedges:creates a PieChart that uses only red, white, and blue colors for the wedges:
11.Add a drop shadow filter to a PieChart control, Flex renders that drop shadow filter in addition to the default drop shadow filter on the PieSeries.Add a drop shadow filter to a PieChart control, Flex renders that drop shadow filter in addition to the default drop shadow filter on the PieSeries.
12.Create a PieChart control and applies a drop shadow to itCreate a PieChart control and applies a drop shadow to it
13.Set nameField property of a PieChart control's data series to ExpenseSet nameField property of a PieChart control's data series to Expense
14.PieChart with ActionScriptPieChart with ActionScript
15.Handle PieChart item click eventHandle PieChart item click event
16.Set selection model for PieChart to single selectableSet selection model for PieChart to single selectable
17.Describe the properties of the PieChart's PieSeriesDescribe the properties of the PieChart's PieSeries
18.defines an Array of custom SolidColor objects, and applies it to the PieSeries object in the PieChart control.defines an Array of custom SolidColor objects, and applies it to the PieSeries object in the PieChart control.
19.Doughnut PieChart(PieChart with a hole)Doughnut PieChart(PieChart with a hole)
20.Exploding PieChartExploding PieChart
21.creates a PieChart that uses a spectrum of reds for the wedges:creates a PieChart that uses a spectrum of reds for the wedges:
22.Pie custom LabelPie custom Label
23.Pie ExplodePie Explode
24.Pie Multiple SeriesPie Multiple Series
25.Pie Set Fill ColorsPie Set Fill Colors
26.The fourth data point, the Car expense, is explodedThe fourth data point, the Car expense, is exploded
27.Get selected index from ChartItemEventGet selected index from ChartItemEvent
28.Change chart data provider and update data series after clickingChange chart data provider and update data series after clicking
29.Pie Label position calloutPie Label position callout