- Create charts simply by using URL with some parameters
- Inserting the chart is as simple as you would be inserting an image
- The chart is created on the fly dynamically
- No need of server side coding
- No need of JavaScript to code or view your chart
- Any resolution of the chart with only a change in URL parameters
- Manipulating the parameters of the URL would change the chart
- A variety of styles to choose as per your tastes.
Lets take a simple case study for our chart. Suppose you are showing Contribution to orgnization using monthly and yearly basis and instead of showing the data in tabular format you could show the data with some visual cues. Charts are the perfect way to do it.
So if I have to represent this data in the form of a chart then first of all I simply need to choose the chart type. Here i choose the Vertical Bar chart. So for drawing the chart we will have to build a URL with in this fashion:
http://chart.apis.google.com/chart?<parameter 1>&<parameter 2>&<parameter n>
cht=bvg
chd=t:<chart data string> For example:chd=t:25.00,250.00,10.00,175.00,500.00,125.00,50.00,50.00,70.00,150.00,200.00,55.00 (comma ',' separated values indicate the contribution of respective month in the chart)
chs=440x250
chl=chl=Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
chm=t25.00,0000FF,0,0,10|t250.00,0000FF,0,1,10|t10.00,0000FF,0,2,10|......
description: chm=<marker type>,<color>,<data set index>,<data point>,<size>,<priority>|...
chxl=1:|0|USD-600 chxl=<axis index>:|<label 1>|<label n>|..
chco=99C754|54C7C5|999999
Google will do the rest of the stuff for you.
http://chart.apis.google.com/chart? cht=bvg& chs=440x250& chd=t:25.00,250.00,10.00,175.00,500.00,125.00,50.00,50.00,70.00,150.00,200.00,55.00& chl=Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec& chtt=By%20Month%20-%202007& chco=99C754|54C7C5|999999& chxl=1:|0|USD-600& chxt=x,y& chds=0,600& chf=bg,s,fafafa& chm=t25.00,0000FF,0,0,10|t250.00,0000FF,0,1,10|t10.00,0000FF,0,2,10|t175.00,0000FF,0,3,10|t500.00,0000FF,0,4,10|t125.00,0000FF,0,5,10| t50.00,0000FF,0,6,10|t50.00,0000FF,0,7,10|t70.00,0000FF,0,8,10|t150.00,0000FF,0,9,10|t200.00,0000FF,0,10,10|t55.00,0000FF,0,11,10
You are seeing the live representation of the chart above. Left side chart show the Month Contribution for Year(above discussion) and Rigth side show the Year wise Contribution 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.
Comments