Andy Piatt
unread,Aug 22, 2011, 3:11:02 PM8/22/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ax...@googlegroups.com
I have a dynamically generated (from CSV) line chart and custom chart legend, and am running into troubles...
Background:
I have a set color palette that colors both the legend items and the lines that correspond to those legend items. My legend is based on the flex horizontal list and each list item is colored based on this palette (colors 0-# of items in the CSV). As items in the legend are clicked, the corresponding chart line is added/removed from the line series by means of a dataFilterFunction (I maintain a total items array, and an excluded items array). This dataFilterFunction then rebuilds a color palette of current colors that should be used for the remaining lines on the chart. Lastly, the Degrafa SolidStroke uses a colorFunction to iterate through that current color palette assigning colors to each line being displayed, corresponding to the legend items selected for display. I would love to have used the autopalette, but the legend needs to be static in its coloring, and the lines need to match those legend colors.
Problem:
This works great for SOME situations. My initial display colors are off just a bit, but making my first selection from the legend corrects this. When ALL items are selected in the legend (all lines displayed) all lines display as black (the degrafa default). When TWO legend items are selected, both lines display using the first of the two colors returned in the SolidStroke colorFunction. When any other number of legend items are selected, the line colors work perfectly (1, 3, 4, 5 ... n-1). I have a trace function in place to verify that the appropriate hex colors are being returned, and it appears that they are all being properly returned upon request by the SolidStroke colorFunction, so I am kind of at a loss at this point.
Other Info:
The color palette we are using is designed to be color-blind friendly, avoiding colors that could be confused by most of the leading types of color-blindness (found in 5%-9% of men). We would like to continue to use this palette, but I am certainly open to other (auto-generated palette) solutions.
I am using the Axiis and Degrafa SWC files distributed in the Axiis_Examples_Beta_1.0.zip dated Nov 2009 for use with Flex SDK 3.4 (which I am also using for this project).
Any suggestions, ideas, examples, or other approaches would be greatly appreciated!