1 Reply Latest reply on Aug 18, 2010 6:39 AM by Tcarter85

    Dynamic multi-series line chart




        I'm new to Flex and I'm having some problems getting multiple series to plot on a line chart. The chart should add a new line for each Geo selected in a multi select list box.  I am able to successfully add one series on my button click event, but that's all. Even when I have more than one Geo selected, only one line is plotted, but all of the selected Geo's show up in the legend. Also, any selected Geo's also show up in the tool tip for each data point on the one line that is plotted.  The data is coming from a WSDL service.   Here is the code that I have so far.


      Any help is much appreciated.




      for each (var strGeo:String=new String in list.selectedItems)      {                            getUsersResult.token = service.getUsers(strGeo, 'product');        var newLS:LineSeries = new LineSeries();        newLS.yField = 'Count';        newLS.xField = 'Period';        newLS.displayName = strGeo;        newLS.dataProvider = getUsersResult.lastResult;        var tmp:Array = linechart1.series;         tmp.push(newLS);        linechart1.series = tmp;         linechart1.invalidateSeriesStyles();                       }