Hybrid Hacking

Subscribe

 

Hybrid Hacking provides tutorials on how to integrate with some of today's hottest web services.

 

 

Hybrid Hacking

 

Links

RIApedia
Ryan Stewart
AllFacebook
TechCrunch

 BlogTutorialsAbout 

Generate Dynamic Chart Images using the Google API

Google just released a new addition to their API that allows you to really easily generate an image of a graph or chart.

This is probably one of the simplest web services I have ever used because there is no need to deal with establishing a session, or even signing up.

You simply encode your parameters into a specially crafted URL and Google returns a PNG image of your graph that you can embed directly into your <img> tag.

Here is an example:

Google Chart Sample

This image was generated by the following URL:
http://chart.apis.google.com/chart?cht=p3&chs=500x200&chtt=Sales&chd=t:65,25,10&chl=Americas|Asia|Europe

Notice that the URL to create that image has a few parameters:

  • cht=p3 (chart type)
  • chs=500x200 (size)
  • chtt=Sales (title)
  • chd=t:65,25,10 (the data)
  • chl=Americas|Asia|Europe (labels)

The functionality is actually quite robust and customizable considering how simple it is. Check out the Google Chart API Developer's Guide for more information.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
 

Copyright © 2007