How do I generate a list of unique colors dynamically in AS? similar
to how Flex does in default charts, except in a per-item fill scenario?

CONTEXT
I want to color code an Hlist of categories to match the dot colors in
a per-item filled Plot Series.

I have an arrayCollection dataProvider that is a list of categories
[categoryid,category]. (number of categories is unknown/unlimited).
I'd like to generate a unique color number corresponding to each
category in the array and update that arrayCollection with the
generated color numbers.[categoryid,category,color]

I'd like to use this resulting [categoryid,category,color]
arrayCollection as a dataProvider to a horizontalList (dynamic legend
list) and a PlotChart per-item fill (Ifill) to color code the dots for
each category. User clicks on a color/cat in Hlist, filters the dots
for the selected category. Colors in the Hlist match the corresponding
colors in the plotchart.

I know how to color code the horizontalList, build the fillFunction,
and do the filterFunction...

but I don't know how to generate the unique colors (much like Flex
does for the default colors in charts) in a per-item fill scenario.

I'm assuming I'd loop through the arrayCollection of categories and
update the color dynamically using some color generator? The colors
need to be as unique as possible.

It would be cool if I could somehow use Flex's built-in default unique
colors for chart series in the per-item fill case?

I could create a color column in the category table in the database,
and store colors there for each one, but seems to me that AS might be
a better approach.

Thanks!
Don





Reply via email to