James.Cridland.net

James Cridland's blog

Where radio and new platforms collide. With beer.

|

Google Charts API - using PHP

Thursday, December 6th, 2007

Google have just released the Google Chart API which enables you to produce swizzy graphs like the above, which is the total ‘hours-listened’ to BBC Radio 1 from March 1999 to September 2007.

In their API documentation, they publish some JavaScript code to help with encoding the URL.

I’ve quickly whipped up a near-equivalent in PHP, which you’ll find here.

I’ll not be using it in its current form, at least not replacing my ugly home-grown graphs: the API doesn’t add labels above the data, which I currently use - but it’s a really handy bit of code from Google, and I might use it elsewhere. Thanks, chaps.