Hi Ben,

If you're just looking for a way to have the legend display 
different items than the chart, instead of setting the Legend's 
dataProvider to the chart, set it to an array of items you want 
displayed. In Flex 1.5, I did this by setting the Legend 
dataProvider to a copy of the array used for the chart's series 
property; I believe the same approach should work in Flex 2 as 
well.  If you are displaying markers for the legend, you may also 
need supporting code to set the markers' fill and stroke styles so 
that they match the chart's styles.

Doug

--- In flexcoders@yahoogroups.com, "ben.clinkinbeard" 
<[EMAIL PROTECTED]> wrote:
>
> Anyone?
> 
> --- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
> <ben.clinkinbeard@> wrote:
> >
> > Hello, I have a ColumnChart whose columns are based on 
selections in
> > another part of the app. So there can be anywhere between 1 and 4
> > column sets. Unfortunately, I can't figure out how to add the
> > ColumnSeries items dynamically, so my legend always has 4 items,
> > regardless of the actual data. Here are my ColumnChart and Legend
> objects:
> > 
> > <mx:ColumnChart dataProvider="{chartObj}" id="column">
> >     <mx:horizontalAxis>
> >             <mx:CategoryAxis dataProvider="{chartObj}" 
categoryField="PAAge"/>
> >     </mx:horizontalAxis>
> >     <mx:series>
> >             <mx:Array>
> >                     <mx:ColumnSeries 
displayName="{arr_legend.getItemAt(0)}"
> > yField="{arr_legend.getItemAt(0)}"/>
> >                     <mx:ColumnSeries 
displayName="{arr_legend.getItemAt(1)}"
> > yField="{arr_legend.getItemAt(1)}"/>
> >                     <mx:ColumnSeries 
displayName="{arr_legend.getItemAt(2)}"
> > yField="{arr_legend.getItemAt(2)}"/>
> >                     <mx:ColumnSeries 
displayName="{arr_legend.getItemAt(3)}"
> > yField="{arr_legend.getItemAt(3)}"/>
> >             </mx:Array>
> >     </mx:series>
> > </mx:ColumnChart>
> > <mx:Legend dataProvider="{column}"/>
> >
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to