Thursday, February 28, 2008

Google Charts & Gadgets

I got a bee in my bonnet today to play around with Google Gadgets and Charts. The charts in Analytics are so beautiful that I wanted to play with sometihng similar on my own, so I decided to add a gadget to my iGoogle page showing my lap times from skate practice. Every month our coach times us skating 1 lap and 3 laps, so what better way to track my improvement than to throw it into a graph, right?

A word to the wise: although you'd think that gadgets would be an easy way to get started with Google Charts (whose Developer Guide is pages long and details dozens of URL parameters), I actually couldn't figure out how to make them work. The line graph gadget requires a field labeled "Data source URL", which means you need to encode the data you want to display using one of Google Charts' data encoding formats, which is non-trivial (especially for someone expecting the plug-and-play simplicity of most gadgets), and the gadget comes with no instructions whatsoever (do I need a full Charts URL? Just the data parameter? Can I add in additional chart parameters?). I spent long enough researching data encodings and chart URL parameters that I figured I might as well create my own charts from scratch rather than using the gadget.

Here's what I ended up with: Lap times The left axis shows my 3-lap times, the right axis my 1-lap times. I was actually surprised by how closely the curves match each other. I only have 2 months of data (I missed January), so I'm looking forward to a few more months' worth to see how the charts grow over time.

No comments: