Use ActionScript to add a series to the chart's series array. This should get you started:
var s:LineSeries = new LineSeries(); s.yField="Points"; s.dataProvider = secondPerson; var oldSeries:Array = myChart.series; oldSeries.push(s); myChart.series = oldSeries; hth, matt horn flex docs > -----Original Message----- > From: flexcoders@yahoogroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard > Sent: Wednesday, June 28, 2006 4:13 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Variable number of columns in ColumnChart > > Anyone? > > --- In flexcoders@yahoogroups.com > <mailto:flexcoders%40yahoogroups.com> , "ben.clinkinbeard" > <[EMAIL PROTECTED]> 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 --------------------~--> Something is new at Yahoo! Groups. Check out the enhanced email design. http://us.click.yahoo.com/SISQkA/gOaOAA/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/