Dynamic graphs can update their display whenever the underlying data changes. For instance, you may interrogate a REST service every minute for stock prices and may want the display to reflect the latest data.
There are many ways you may want to update the graph:
Update the entire graph with a new data set
Add data to the graph and possibly remove the oldest data
Update random values
This recipe will demonstrate the first problem, since it can be used to solve all three. However, depending on your situation, you may want to add custom manipulation routines to the graph (see the There's more… section towards the end of this recipe).
This recipe starts from the following document class:
package com.graphing.dataupdate { import flash.display.Sprite; import com.graphing.PointGraph; public class Recipe2 extends Sprite { private var _graph:PointGraph; private var _data:Array = [[0,20],[50,70],[100,0],[150,150],[200,300...