Chart Flex


    
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"
    creationComplete="initApp();" height="600">
     
         
        import flash.events.KeyboardEvent; 
        import mx.core.FlexGlobals; 
    import mx.collections.ArrayCollection;
    [Bindable]
    public var expenses:ArrayCollection = new ArrayCollection([
      {Month:"Jan", Profit:20, Expenses:15, Amount:145},
      {Month:"Feb", Profit:1, Expenses:2, Amount:60},
      {Month:"Mar", Profit:15, Expenses:5, Amount:3}
      ]);
        
        private function initApp():void { 
            FlexGlobals.topLevelApplication.addEventListener(KeyboardEvent.KEY_UP, keyHandler); 
        } 
        // Clears all chart items selected when the user presses the ESC key. 
        private function keyHandler(event:KeyboardEvent):void { 
            var curKeyCode:int = event.keyCode; 
            if (curKeyCode == 27) { // 27 is the keycode value for ESC 
                myChart.clearSelection(); 
            } 
        } 
      
    

    
        
    

    
        
            
        

                    showDataTips="true" dataProvider="{expenses}"
            selectionMode="multiple">
            
                                    displayName="Expenses/Profit" selectable="true" />
                                    displayName="Amount/Expenses" selectable="true" />
                                    displayName="Profit/Amount" selectable="true" />