Search

Google Chart API Released

0 views

Google released a chart generator service they are calling the

Prompt
http://chart.apis.google.com/chart?cht=<br />p3&chd=t:90,49&chs=350x150&chl=Foo|Bar

... and Google returns a PNG graphic containing the chart. For instance, above URL results in the following image:

' /></p>
<p>Splitting up the image URL parameters, you can see what it's made up of:</p>
<div class=
Prompt
cht=p3
the chart type, in this case, a pie chart
Prompt
chd=t:90,49
the chart values, text-encoded, and separated by a comma
Prompt
chs=350x150
the custom chart size, 350x150 pixels
Prompt
chl=Foo|Bar
the different labels for the pie chart sections, separate via the pipe character

I'm not linking live to Google but caching this image on my server instead, just in case, as Google limits your requests to this API to 50,000 per day. Even with that limit, you can grab the image and do the caching on your own server automatically (by copying the binary), which would mean 50,000 requests will be good enough for many use cases.

This service is really neat all in all. The

Here are couple of more examples of what can be done with the Chart API (cached again, but click them to see a live parametrized version):

' /></a>     <a href=' /></a></p>
<p>Also see how you can <a href=kidnap Google Page Creator's image generator

[Via Reto!]

Suggest a Correction

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!