Whilst doing some work on an Mathematics Learning Object I was confronted with the problem of having to be a variety of different graphs.
Due to the way that these projects change over the construction period it soon became apparent that hand drawing these graphs would be too time consuming, so I set out to create some classes that could do most of the heavy lifting.
After a bit of planning and a lot of head scrathing I finally came up with some classes that would do 95% of what I needed to do with the added bonus of being run from an external XML file structure.
The flash file below is an example of some of the things the classes could do.
Without getting into the boring details it basically works like this:
That's about it. There was lots of little nances like conditionals controlling line visibilty and figuring out what numbers should appear, etc. but nothing that was hard.
This was one of the first things that I ever had to program in ActionScript 3 so it is a bit rough, but overall it seems to work pretty well.