-
Book Overview & Buying
-
Table Of Contents
ActionScript Graphing Cookbook
By :
Well truth be told, we won't really be making histograms with this recipe but mostly bar charts in the style of histograms. Histograms are very rigid in their nature and follow really specific mathematical functions to represent frequency and density. You can read more on histograms on Wikipedia: http://en.wikipedia.org/wiki/Histogram. What we are going to do here is build a histogram styled bar chart (no space between the bars) that uses a function as input. You can think of this as a different way to do an area chart or a line chart.

The data for this recipe is a bit different as it uses a mathematical function instead of a data set. You can get a mathematical function using interpolation or by having a program such as Microsoft Excel do it for you.
The following are the steps required to build a histogram using ActionScript 3:
Now if you look at our Main.as class, you will notice that it is quite small compared to the previous recipe. For this...
Change the font size
Change margin width
Change background colour