This might be one of the best API’s available now. The reason? Everything is through the URL. Google defines their new charting API as:
The Google Chart API is an extremely simple tool that lets you easily create a chart from some data and embed it in a web page. You embed the data and formatting parameters in an HTTP request, and Google returns a PNG image of the chart. Many types of chart are supported, and by making the request into an image tag you can simply include the chart in a web page.
The API provides different types of charts like Line, Bar, Pie, Venn diagram etc. To create any chart, we just have to pass some parameters to the URL: http://chart.apis.google.com/chart, specifying chart size, type and date. The generic syntax will be as follows :
http://chart.apis.google.com/chart?<parameter1>&<parameter2>&<parametern>
So, you just created your Hello World chart using the API. All charts are generated as PNG images. Now lets look at the analyze the “Hello World” chart we just wrote.
You should have noticed that we passed 4 parameters, cht, chd, chs and chl. “ch” obviously stands for chart.. cht represents the chart type, chd the data, chs the size of chart and chl the charts label. The API provides different type of data encoding like simple, text and extended encodings.
Here’s some example..
Let me dig deeper and see how I can make use of this library! :)
No comments :
Post a Comment