If you set a breakpoint in the debugger in your myFillFunction method
below and you inspect element:ChartItem, what is in the item property?  

It should be the object corresponding to that datum in the data
provider you have attached to the chart.  From there you should be
able to get at whatever you want in your domain model.

Not wishing to sound didactic, but how about having a copy of the Flex
language reference on your desktop?  If you don't already have it as
part of your install then you should be able to download it from the
web.  If you can't find it send me a message at simon dot palmer at
gmail dot com and I'll zip it up and send it to you.  I find it a real
shortcut.

I also really recommend spending a day or two poring over the code on
sites like Ely Greenfield's quietlyscheming.com, Peter Ent's blog at
Macromedia, Alex Harui's Flex Closet and the flexlib at google.  There
are a million resources free on the web with clever ideas and code
samples.

Simon

--- In flexcoders@yahoogroups.com, "nasawebguy" <[EMAIL PROTECTED]> wrote:
>
> 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