Great Fernando.  Thanks for the info too.  I learned something as well.

-TH

--- In flexcoders@yahoogroups.com, "Fernando Ghisi" <[EMAIL PROTECTED]>
wrote:
>
> When you do this in a MXML, I almost sure that it will be transformed
> on a setStyle("itemRenderer", ...) in actionscript.
>
> There is no other way of doing this on actionscript.
>
> "To apply a renderer to a series in ActionScript, you use the
> setStyle() method. In that method, you create a new ClassFactory and
> pass the renderer to its constructor. Flex generates an instance of
> this class to be the renderer. Be sure to import the appropriate
> classes when using renderer classes."
>
>
> But you gave me a solution - when I set the itemRenderer for one
> serie, in fact I´m setting the itemRenderer for all items of this
> serie. So, I can really get a reference using the serie´s items
array,
> like you said or, more especificaly, like this:
>
>
CustomItemRenderer(ColumnSeriesItem(ColumnSeries(chart.series[index]).it\
ems[index]).itemRenderer
>
>
> That was easier than I thought it was.
>
>
> Thanks for the "light" Tim!
>
>
> Fernando Ghisi
>
>
>
>
>
> 2008/9/8 Tim Hoff [EMAIL PROTECTED]:
> > Not arguing with you, but why would you use setStyle instead of:
> >
> > <mx:ColumnSeries
> >
> > id="mySeries"
> > itemRenderer="mx.charts.renderers.CustomtemRenderer"/>
> >
> > Does mySeries.items[0] not give you a reference?
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com, "Fernando Ghisi" fernandoghisi@
> > wrote:
> >>
> >> The question here is not if charts uses styles for itemRenderers or
> >> not - it´s fact, it really uses it.
> >>
> >> It´s working like this: I created my CustomItemRenderer
extending
> >> BoxItemRenderer and I´m setting the series itemRenderers with
setStyle
> >> method, like this:
> >>
> >> //For each columnSeries
> >> series.setStyle("itemRenderer", new
> >> ClassFactory(mx.charts.renderers.CustomtemRenderer));
> >>
> >> See also:
> >>
http://livedocs.adobe.com/flex/3/html/help.html?content=charts_formattin\
g_12.html
> >>
> >> It´s working, I repeat. But the question was how can I get a
reference
> >> for the series itemRenderes. On execution time, I have to modify an
> >> attribute of the itemRenderes than, when the updateDisplayList is
> >> executed again, the renderer will modify the draw made on each
column
> >> (based on the attribut setted).
> >>
> >> If I use serie.getStyle("itemRenderer"), it will return the
> >> ClassFActorty, not the itemRenderer.
> >>
> >>
> >> So, any idea people?
> >>
> >>
> >> --
> >> Fernando Benedet Ghisi
> >>
> >
>
>
>
> --
> Fernando Benedet Ghisi
>



Reply via email to