views:

263

answers:

2

Hi All,

I am writing a custom item renderer to render a column series in my application. Its a stacked chart and i want to use the same item renderer for both the column series. The color for each series in the stack is different and am setting that in the 'fill' property of the two series. My doubt is how can i get the color specified in the fill property of the column series from the item renderer. if this works then i can very well use the same renderer for both series.

Thanks in advance, Anoop

A: 

If your renderer component extends container, you can just set the background color style based on the data.

Listen to the data change event to swap colors.

www.Flextras.com
A: 

Hi All, I was able to crack this down finally. It was very simple. In the item renderer I declared a public variable with datatype uint to store the fillcolor. In the column series instead of giving like 'itemRenderer="LabeledRenderer"' I gave like this :

<mx:ColumnSeries ....>
     <mx:itemRenderer>
    <mx:Component>
         <local:LabeledRenderer3 fillColor="0x819CCC"/>
    </mx:Component>
     </mx:itemRenderer>
</mx:ColumnSeries>

Bingo! It worked perfectly. Cheers, PK

Anoop