2 Replies Latest reply on Dec 6, 2007 5:44 PM by omsy

    refreshing a chart after adding a new series?

    omsy
      this must be really simple and i'm just missing something. suppose i have a chart, and i add 2 lines series, and then make the chart visible (well, make the whole thing visible via "this.visible = true"). great, everything works. BUT, if i add 1 series, set this.visible = true, and then at a later time add another series (via chart.push(seriesObject)) the display does not update with the new series.

      i assume there is just something simple i need to do to cause the notification to occur and updates to happen. help!
        • 1. Re: refreshing a chart after adding a new series?
          peterent Level 2
          This is a little "feature" of ActionScript. If you take a look at the Chart class, you'll see that the series property is actually a pair of set and get functions. When do:

          chart.series.push( seriesObject );

          all you are doing is accessing the get function - the chart doesn't know you touched the series. If you have to invoke the series set function. This is (my) recommended way:

          var series:Array = chart.series;
          ...
          series.push( seriesObject );
          chart.series = series; // invoke the set function.

          Now the chart should update with your new series.
          • 2. Re: refreshing a chart after adding a new series?
            omsy Level 1
            worked like a charm. just getting into action script, that pointer is helpful.

            cheers

            omar