Color for individual rectangles

1 view
Skip to first unread message

Jan Mechtel

unread,
Apr 25, 2009, 1:36:09 PM4/25/09
to juicekit
Hi,
I got the treemap to work. Really nice work thank you for making this
available.

Just wondering how I could set the color of individual rectangles
freely (instead of the value on a gradient between two colors).

Thanks for hints

Jan

Jon

unread,
Apr 25, 2009, 4:04:50 PM4/25/09
to juicekit
Jan,

Step #1: On Monday, I will put a patch TreeMapControl.as to change:
private function get colorPalette():ColorPalette {
-to-
protected function get colorPalette():ColorPalette {

If you need the change sooner, you can always make the change yourself
in a temporary branch.

Step #2: You can need to derive a specific class from TreeMapControl
and return a different ColorPalette instance with your color values.
The documentation for ColorPalette is in the Flare module.

You must still map a data value to a color as the controls are data
driven. You will just be mapping a particular data value to a
particular color to get the effect you want.

Cheers,
Jon

Jan Mechtel

unread,
Apr 25, 2009, 4:17:53 PM4/25/09
to juic...@googlegroups.com
Hi Jon,
thanks for the quick reply. i actually have only gotten into
programming Flex because of juicekit. I might give it a try tomorrow.
But also git is new to me and until now I was able to just use the
treemap component and not actually compile it myself.

Your methods sounds good, lets see if I got the time tomorrow
otherwise I would really appreciate you putting it in on Monday!

Have a nice weekend.

Jan

2009/4/25 Jon <jon.buf...@gmail.com>:
--
Jan Mechtel
+49 30 8101 9870
Reply all
Reply to author
Forward
0 new messages