Chart Flex




    
        import mx.charts.*;
        import mx.collections.ArrayCollection;
        [Bindable]
        public var expenses:ArrayCollection = new ArrayCollection([
            {Month: "Jan", Income: 2000, Expenses: 1500},
            {Month: "Feb", Income: 1000, Expenses: 200},
            {Month: "Mar", Income: 1500, Expenses: 500}
            ]);
        // This method customizes the values of the axis labels.
        // This signature (with 4 arguments) is for a CategoryAxis.
        public function defineLabel(cat:Object,pcat:Object,ax:CategoryAxis,labelItem:Object):String{
            // Show contents of the labelItem:
            for (var s:String in labelItem) {
            trace(s + ":" + labelItem[s]);
            }
            // Return the customized categoryField value:
            return cat + " '07";
            // Note that if you did not specify a categoryField,
            // cat would refer to the entire object and not the
            // value of a single field. You could then access
            // fields by using cat.field_name.
       }
            // For a NumericAxis, you do not use the labelItem argument.
            // This example uses a NumberFormatter to add a thousands
            // separator.
        public function defineVerticalLabel(cat:Object,pcat:Object,ax:LinearAxis):String{
            return "$" + numForm.format(cat);
        
        }
      

    
    
        
            
                                    labelFunction="defineLabel" />
            

            
                                    labelFunction="defineVerticalLabel" />
            

            
                                    displayName="Income" />
                                    displayName="Expenses" />