Chart Flex



  
     import mx.collections.ArrayCollection;
     import mx.charts.events.ChartItemEvent;
     [Bindable]
     public var myArray:ArrayCollection = new ArrayCollection([
        {Country:"A", GDP:1},
        {Country:"B", GDP:6},
        {Country:"C", GDP:4},
        {Country:"D", GDP:2},
        {Country:"E", GDP:3}
     ]);
     [Bindable]
     public var americanGDP:ArrayCollection = new ArrayCollection([
        {Category:"X", GDPContribution:1},
        {Category:"Y", GDPContribution:2},
        {Category:"Z", GDPContribution:2}
     ]);
     private function itemClickHandler(e:ChartItemEvent):void {
        myChart.dataProvider = americanGDP;
        ps1.field="GDPContribution";
        ps1.nameField="Category";
     }

  
             dataProvider="{myArray}"
        showDataTips="true"
        itemClick="itemClickHandler(event)"
        selectionMode="single" >