Developers who have been using Google Analytics for any time can appreciate the flexibility and power behind some of the graphing software it offers. I recently found myself wondering just how they get the incredibly usable effect they have, so I began tinkering with some Actionscript and soon found myself with a very workable base that not only could be modified and grown to match what this software offers but is also surprisingly simplistic in nature.
Basically, we simply have our main application (or graph in this case) that can take any number of argument values and calculate not only their position based on ratio but also spreads them across the graph in a readable way. So, we create a simple point object that handles the visuals – both the expanding and contracting as well as the showing and hiding of the value text – and allow our graph to do some very simple calculations to spread them out evenly.
Continue reading