Following on from my earlier post on the Google Chart API, I have been playing around with the API a bit more. This time I’ve been focusing on sparklines.
Followers of the work of Edward Tufte will be familiar with sparklines. Properly described, they are small, high resolution graphics embedded in a context of words, numbers, images. Simply described, they are graphs that fit in a line. Examples are always good so returning to the the previous post’ example of Irish generation of electricity from wind over the past six years, were we to represent it with a sparkline and it would look like this: .
Hmmm, but that doesn’t look very informative. There are no labels, for example, and its hard to grasp a sense of scale (full graph for comparison). The simplicity of a sparkline belies its power. With a glance I can see that windpower generation in Ireland has been increasing. The power of sparklines becomes more apparent when you want to quickly visualise and compare several sets of data, share prices of competing companies would be a good example. For my next example though I’m going to depict US military personnel wounded in Iraq since 2003 (data). To show-off the potential of this visualisation method even more, green lines are used to indicate a downward trend in figures, red is upward and grey is used where the trend was ambiguous:
2003
2004
2005
2006
2007
What has really impressed me here is how simple it was for me to generate these sparklines. In the past I’ve played around with graphic modules in both Perl and Ruby in an attempt to generate sparklines but none have come close to the simplicity and ease of use of the Google API. Most impressive of all has been that no matter what image dimensions I feed to Google, the returned sparkline is always properly rendered and well scaled.
Further reading:
- Good introduction to Google Charts from 24ways
- Scaling in Google Chart
- Chart generation website (Useful if you don’t want to encode your own datasets)
- Google Groups
Posted in technology, visualisation
