Thanks Jonathan, I'll give it a try. Just one question -- could you clarify if:
s.dataField = yourData[i].dataField in your code below should really be: s.dataProvider = yourData[i].dataField as I don't see a dataField property available for a LineSeries. ----- Original Message ----- From: "Jonathan Campos" <[email protected]> To: "users" <[email protected]> Sent: Thursday, April 18, 2013 8:45:22 AM Subject: Re: how to dynamically add multiple LineSeries to a chart? On Wed, Apr 17, 2013 at 12:04 PM, <[email protected]> wrote: > Please set me straight how to dynamically add LineSeries the proper way. > Thanks for any help/advice. It's actually much easier than you are even doing it, pseudo code to follow: //loop your data describing the series that will be created var i:int = -1; var n:int = yourData.length; var genLineSeries:Array = []; while(++i<n) { var s:LineSeries = new LineSeries(); //add properties as necessary to series //based on your data s.dataField = yourData[i].dataField; genLineSeries.push(s); } //assuming your chart lineChart.series = genLineSeries; //done -- Jonathan Campos
