8 Replies Latest reply on Jul 20, 2006 2:00 PM by katerini

    Add a data series dynamically in charts

    flex_dragon
      I am trying to add a data series dynamically in a chart but it does not seems to work. Here is the sample code. Any idea?

      var line1:LineSeries=new LineSeries();
      line1.dataProvider=[something];
      line1.displayName="New data";
      chart.secondSeries.push(line1);

      It works if I do the following but I don't want to remove other series already there.

      var arr = new Array();
      chart.secondSeries=arr;
      var line1:LineSeries=new LineSeries();
      line1.dataProvider=[something];
      line1.displayName="New data";
      arr.push(line1);