Counter

My journal in Australia

Monday, May 12, 2008

Google Chart API

Bookmark and Share
Amazing feature provided by Google, I love you so much. Now, you can have your personal shining charts with many types in your blog.


It's beautiful, right? You only need one line HTML tag to own this,
<img style="cursor:pointer; cursor:hand;width: 400px;" src="http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World" border="0" alt="" />

The URL is in the format as below:
http://chart.apis.google.com/chart?<parameter 1>&<parameter 2>&<parameter n>

According to the former format, the URL above can be divided as:
http://chart.apis.google.com/chart?
chs=250x100
&chd=t:60,40
&cht=p3
&chl=Hello|World

where
  • http://chart.apis.google.com/chart? is the Chart API's location.
  • & separates parameters.
  • chs=250x100 is the chart's size in pixels.
  • chd=t:60,40 is the chart's data.
  • cht=p3 is the chart's type.
  • chl=Hello|World is the chart's label.
So many types of charts are available!!
Line chart
Chart with line in yellow

Sparkline
Sparkline

Bar chart
Vertical bar chart with two data sets: one data set is colored in dark blue the second is stacked in pale blue

Pie chart
Two-dimensional pie chart with six segments where segment colors are interpolated from dark to pale orange

Venn diagram
Venn diagram with three overlapping circles

Scatter plot
Scatter plot with default blue circle data points in different sizes as defined by a third data set

Radar chart
Radar chart
Map
Map of Africa

Google-o-meter
Google-o-meter with default red to green coloring

Here to see the guide to use them.

0 Comment: