Flex charting --> Customizing legend label styles

164 views
Skip to first unread message

Robi

unread,
Sep 29, 2007, 2:38:55 AM9/29/07
to Flex India Community
Hi all,
I have a chart in which I have used the button control as the
custom legend marker renderer. Because of this, the legend labels are
not getting colored as per the line series colors. Besides, I couldn't
find any property to set the label color.
Can someone please help me in this?

Thanks,
Robi

Mor

unread,
Sep 29, 2007, 3:05:12 AM9/29/07
to Flex India Community
Robi

Not much clear. Past code.

smalik

unread,
Sep 29, 2007, 12:34:31 PM9/29/07
to Flex India Community
In the marker renderer, u can access the data property and from there
u can get legendData and series element. Since u have the series, u
can know the color. Override the updateDisplayList() of button and put
that color there.

Sandeep

Debabrata Acharjee

unread,
Sep 29, 2007, 12:57:22 PM9/29/07
to flex_...@googlegroups.com
This should work for you:

<?xml version="1.0" encoding="utf-8"?>
<mx:Button
    xmlns:mx="http://www.adobe.com/2006/mxml"
    label="{data.label}"  fontSize="11"
    color="{data.element.inheritingStyles.lineStroke.color}" >
 </mx:Button>
--
Debabrata Acharjee
Consultant RIA Technologies
http://debabrataa.blogspot.com

Debabrata Acharjee

unread,
Sep 29, 2007, 1:03:14 PM9/29/07
to flex_...@googlegroups.com
Forgot to mention! You can use this as your custom legendMarkerRenderer. You can also set the themeColor for the button using the inheritingStyle.
Reply all
Reply to author
Forward
0 new messages