Chart Flex




    
        
        import mx.graphics.IFill;
        import mx.graphics.SolidColor;
        import mx.collections.ArrayCollection;
        import mx.charts.ChartItem;
        import mx.charts.series.items.ColumnSeriesItem;
        [Bindable]
        public var sales:ArrayCollection = new ArrayCollection([
            { Name:"Reiner", CurrentAmount:69000 },
            { Name:"Klaus", CurrentAmount:38000 },
            { Name:"Alan", CurrentAmount:44000 },
            { Name:"Wolfgang", CurrentAmount:33000 },
            { Name:"Francis", CurrentAmount:20000 },
            { Name:"Klaus-Jurgen", CurrentAmount:55000 },
            { Name:"Martin", CurrentAmount:70000 },
            { Name:"Mac", CurrentAmount:35000 },
            { Name:"Friedemann", CurrentAmount:38000 },
            { Name:"Bruno", CurrentAmount:40000 }
            ]);
        private function myFillFunction(element:ChartItem, index:Number):IFill
        {
            var c:SolidColor = new SolidColor(0x00CC00);
            var item:ColumnSeriesItem = ColumnSeriesItem(element);
            var sales:Number = Number(item.yValue);
            if (sales >= 50000) {
                return c;
            } else {
                // They have not met their goal.
                c.color = 0xFF0000;
            }
            return c;
        }
      
    

    
                    showDataTips="true">
            
                
            

            
                
            

            
                                    yField="CurrentAmount" fillFunction="myFillFunction"
                    displayName="Current Sales" />