Include a Chart in a Webpage with Google Chart API

We have been waiting so long for Google Chart API. Google has finally released Google Charts API, which returns a PNG-format image in response to a URL. Several types of image can be generated: line, bar, and pie charts for example. For each image type you can specify attributes such as size, colors, and labels.

You can include a Chart API image in a webpage by embedding a URL within an <img> tag. When the webpage is displayed in a browser the Chart API renders the image within the page.

chart.png

The chart above is generated dynamically and displayed in your browser with the following code.
<img src="http://chart.apis.google.com/chart?cht=p3&chd=s:hW&chs=480x150&chl=Large Portion|Small Portion">
Go and check out the developer’s guide of Google Chart API now.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s