Tuesday, July 29, 2008

Google Charting tools

Just a notice, I work now with PHP designer. It sucks some money, but quite good for development. It supports PHP and Python (also Javascript and other language) that what made me use it!

Ok, I returned to Google Code and Developer API. I was just bored and wanted to get a look on those API. I found a very nice and cool one. Google Chart API. Those API will enable you to create Charts and export them to images (directly embedded on your website, like the examples below).

I read on some comments and blog posts that the number of query is limited to 50,000 per day. Which may be good, but not enough. But here's what I found on the Usage Policy:
There's no limit to the number of calls per day you can make to the Google Chart API. However, we reserve the right to block any use that we regard as abusive, an apparent denial of service attempt for example. If you think your service will make more than 250,000 API calls per day, please let us know by mailing an estimate to chart-api-notifications@google.com.
So it's unlimited now (if it was limited on the past and I don't know!). Any way, that for our good and we can start using it without any fear. (unless Google server goes down or on strike!)

Ok, fast start, the Google Chart API gives you images, like these one.


You can check the images here.
Here's the URL that will query and get back the images
http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World

Now you may wonder how I embedded it to the blog post. (It's the same if you want to embed it to a website or HTML Page.

The following line of code do the necessary


See how it's flexible and easy. But as the graph become more complex, the more the URL is longer, and i think that's the only disadvantages of Google Chart API.

However the cool guys on the web are always working and have made a Google Chart API Code Generator. You have just to fill and the code generator will give you the URL. But I'm not so impressed with the current generator and seems to me quite novice. I'm also thinking of creating one with PHP. If you are interested so let me know.

My sample may make you think that Google Chart API supports only 3d Pie! Ohh no think again it's Google and it beyond your imagination.
Here's some sample that will proof its' power.












Only those? Oh no also a map



More precision here's how I select my country from the crowd ;)



Let's put the full speed, vroooom!



Is this a solution for my future online Barcode?




Like it? So you want to try?
Go to the API Documentation, don't worry, it's too long but you are not going to read it all. Read from the introduction to the Chart Data then choose a chart type and read how to manipulate it.
If you work with it on your website, then you should know how to change the colors, the labels, the styles.

BTWN, contact me if you want that we create a more advanced Google Chart Code Generator. Good luck for your charts!

1 comment:

Unknown said...

It's great to hear that you like our service!

Initially, when the Chart API went live, we asked webmasters to send us not more than 50,000 chart queries per user per day. But we've lifted that limit in March 2008. Still, if you expect a huge amount of traffic (more than 250,000 queries on a typical day), we'd love to know in advance so we can plan for the demand.

-- Sascha Brawer, Google Chart API team

Interested on Microsoft Technologies? Read Visual Studio Dot Net