Nov
9

Working with Google Charts and Visualization API

Red line chart with pale gray backgroundThis week I had the chance to play around with Google’s charts API, and let me tell you that I’m loving it. In the past couple of years I’ve had to integrate charts into the different projects. I have used everything from Fusion Charts, to PHP/SWF Charts, and DOJO’s charting engine. But, since I learned that Google provided developers with an API to create charts on the fly, I wanted to give it a try.

To create static bart chart is as simple as:

<img src="http://chart.apis.google.com/chart?
cht=bvs
&chs=200x125
&chd=t:10,50,60,80,40|50,60,100,40,20
&chco=4d89f9,c6d9fd
&chbh=20&chds=0,160"/>

Let me break out the parameters for you into:
// this is the chart type
cht=bvs
//this is the bar colors
chco=4D89F9,C6D9FD
//this is the chart values
chd=t:10,50,60,80,40|50,60,100,40,20
//chart dimensions
chds=0,160

In the Google Charts API website you can find more info regarding this simple but useful chart api. But, that’s not all. They also have the Google Visualization API where they actually give you more advanced and dynamic set of visualization tools. They pretty much opened their entire library of data visualization helpers to allow developers like yourself create user interfaces that contain elements that some of your users will be used to seeing, since graphs, charts and other elements you will find in this API is already being implemented in google products.

I encourage you to check both, the more simple and straight forward Charts API, or the more advanced and dynamic Visualtization API.

Feel free to let me and the readers know on the exiting ways you are utilizing those API’s

Leave a comment