introducing time-series-graph

A Google Finance-esque Charting Class for Flash written in AS3

Over at Google Code you'll find my new time-series-graph class. It's a simple charting class that lets you insert a chart similar (very similar) to that used by Google in their Finance Pages.

Go over to my project page or just download the .zip file of the class. The .zip file includes

To use the charting class, do the following:

The above code should be pretty self-explanatory, except perhaps for the arrays. You need to have your data that you'd like to graph in two arrays. The first is an array of your data values, from first to last, in chronological order. The second needs to be an array of date objects that corresponds to your value array. Creating these arrays is up to you, though it should be pretty simple.

Other public methods include

Below you'll find an example of the chart in action. I've loaded in George W. Bush's Gallup Poll approval ratings on the main graph window and those who responded "unsure" in the smaller bar chart.

This was originally a part of the Hydrologic Dashboard that I'm working on for UW Sea Grant. I recoded it as a general class so that I (and others) could simply add it to any project. Of course, there's plenty more to do. I can think of a dozen more public methods that could be added to the class. So if you're interested, go ahead and check out the code and go to town.

Coding this has also made me realize that I need to learn Flex. Brendan Meutzner has already coded a very similar but better charting component for use in Flex. And apparently it took much less than the dozen+ hours it took me to create time-series-graph, thanks mostly to the use of mxml and Flex's built-in charting components. I hadn't seen Brendan's component until after I completed mine; at least now Flash programmers can get in on the charting fun.