Single Series only
I see how to change the color of each data item based on the
item.yValue. Very slick. (see my code below). 

However, I'd like my conditions to be compared to data in my
dataProvider for each item, instead of just the yValue. For example,
my dataProvider includes "type." type can be one of three strings
(type1,type2,type3). If type = 'type1', then use one color, if type2,
another...

I don't know how to reference it. I know how to use hitData for
dataTips, but not in the context of IFill.

Can you suggest a mod to code below or a better way to change the
color of the circles?

Or how to change the itemRenderer shape, in a similar way. Ideally,
I'd like the color to indicate yValue, and the shape to indicate type.

Thanks,
Don


private function myFillFunction(element:ChartItem, index:Number):IFill {
        var h:SolidColor = new SolidColor(0x00CC00);
        var m:SolidColor = new SolidColor(0xfbf805);
        var l:SolidColor = new SolidColor(0xFF0000);
        var item:PlotSeriesItem = PlotSeriesItem(element);
        var priority:Number = Number(item.yValue);       

        if (priority >= 30) {
            return h;
        } 
        else if (priority > 20 && priority < 30) {
                return m;
        }
        else {
            // They have not met their goal.
            l.color = 0xFF0000;
        }
        return l;
        
    }

Reply via email to