-
Book Overview & Buying
-
Table Of Contents
ActionScript Graphing Cookbook
In this recipe we are going to create a quotes graph that shows the value of an action, in this case the Google action, for one day. Every minute the graph is going to update itself and the update is going to be animated.
Open the files downloaded from the Packt Publishing website, look into the Chapter 7 | recipe 3 folder and follow along.
The following are the steps required to build this graph:
Get the HorizontalAxis and VerticalAxis class from the Drawing a bar chart with Flex recipe in Chapter 3, Creating Bar Charts.
In HorizontalAxis.as, remove the labels; we won't be needing them.
In VerticalAxis.as, add minimumValue as a parameter. This axis is not going to start at 0 for this recipe but at the minimum value specified. The following is the line that needs to be modified (range is the difference between maximumValue and minimumValue).
textField.text = String(Math.round(((i + 1) / (_numberOfMarks)) * range + minimumValue));
Now create LinePart...
Change the font size
Change margin width
Change background colour