Chart Flex


    
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"
    height="600">
     
         
        import mx.collections.ArrayCollection; 
        [Bindable] 
        public var expenses:ArrayCollection = new ArrayCollection([ 
            {Month:"Jan", Profit:2000, Expenses:1500}, 
            {Month:"Feb", Profit:1000, Expenses:200}, 
            {Month:"Mar", Profit:1500, Expenses:500} 
        ]); 
      
    

    
        
    

     
        import mx.charts.series.ColumnSeries; 
        import mx.collections.ArrayCollection; 
        private var series1:ColumnSeries; 
        private var series2:ColumnSeries; 
        private function addMoreSeries():void { 
            if (!series1 || !series2) { 
                series1 = new ColumnSeries(); 
                series1.dataProvider = expenses; 
                series1.yField = "Expenses"; 
                series1.xField = "Profit"; 
                series1.displayName = "FE"; 
                series2 = new ColumnSeries(); 
                series2.dataProvider = expenses; 
                series2.yField = "Expenses"; 
                series2.xField = "Profit"; 
                series2.displayName = "STRK"; 
                var currentSeries:Array = myChart.series; 
                currentSeries.push(series1); 
                currentSeries.push(series2); 
                myChart.series = currentSeries; 
            } 
        } 
        private function resetApp():void { 
            myChart.series = [ series0 ]; 
            series1 = null; 
            series2 = null; 
        } 
      

    
        
            
        

        
            
                
            

            
                                    id="series0" yField="Expenses" xField="Profit" displayName="FRED" />