Google Chart API : An overview

I was recently going through the various Google APIs that are available when the Google Chart API caught my fancy.
According to Google
The Google Chart API lets you dynamically generate charts. To see the Chart API in action, open up a browser window and copy the following URL into the address bar:
http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250×100&chl=Hello|World
Press the Enter or Return key and – presto! – you should see the following image:
So i thought why not try to use it and let you know how to use it.
So firstly i got the “OS Distribution” and “Browser Distribution” data for this site.
Since I am also a first time user i read through the Google Chart API : Developer’s Guide and learnt how to use the same.
After getting the data which i would use to display my charts i first rounded off the data so that as a n00b generating the chart would not be a problem for me.
I think there would be ways that would allow using fractional data with the Google Charts API, but then again i would need to find it out.
Also that would mean that the URL that you create would be a hell lot LONG. But then again unless we experiment and see we won’t know ![]()
So for the first chart aka the “OS Distribution” chart i used the following URL:
http://chart.apis.google.com/chart?cht=p3&chd=s:4kFCB&chs=550x200&chl=Windows (56%)|Linux (36%)|Unknown (5%)|Mac (2%)|BSD (1%)&chco=FF3366,3399FF,CCFF33,B870FF,FFFF70
and for the “Browser Distribution” chart i used the following URL:
http://chart.apis.google.com/chart?cht=p3&chd=s:zVOEDCCBBB&chs=550x200&chl=Firefox (51%)|IE (21%)|Opera (14%)|Unknown (4%)|Google Chrome (3%)|Mozilla (2%)|Safari (2%)|Konqueror (1%)|Netscape (1%)|Galeon (1%)&chco=FF3366,3366FF,CCFF33,FFFF70,B870FF,00EBEB,660000,00A3A3,FFCC99,99CCFF
So then what are we waiting for…
Here is the final result…
Disclaimer: The above two images are not hand made and not even hosted on my server. They are generated directly by Google.
This is all that is there for now.
Wait for the next post to clarify what all the parameters are in the URL are and how to modify those.
That would need a really detailed explanation and i won’t disappoint you..promise
Thanks for the interesting information.
Thanks for dropping by…