1 Reply Latest reply on Jan 9, 2008 8:02 AM by Deeptika Gottipati

    Optional chart series

    tduffey Level 1
      I have a column chart with at least one series, possibly more depending on user input. In my mxml file I currently define all the possible series but this shrinks the width of all the columns and adds an item to the legend even if I don't supply data for each series.

      Is it possible to programmatically add or remove a series from a chart?
        • 1. Re: Optional chart series
          Deeptika Gottipati Adobe Employee
          A chart's 'series' property is just an array of Series objects. So, elements can be added to or removed from this array using ActionScript.

          The following code snippet will add series to chart's series array

          var exampleSeries = new ColumnSeries();
          chartId.series.push(exampleSeries);
          invalidateSeries();