This pie chart looks better than some dry ratio numbers, isn’t it?
The pie chart above can be created on the fly with this simple piece of html code:
<img src=”http://chart.apis.google.com/chart?
chs=250×100
&chd=t:10,90
&cht=p3
&chl=Smart|Silly”
alt=”Sample chart” />
Interesting here:
1. With http://chart.apis.google.com/chart you call the Google Chart Api
2. This alone gives us of course not yet a nice pie chart – we have to add some parameters
For example with &chd=t:10,90 we get a 10% | 90% ratio of the pie chart.
Means you could manipulate this ratio with some php values. The number of smart people might increase…
<?php
$silly = 5;
$smart = 95;
?>
<img src=”http://chart.apis.google.com/chart?
chs=250×100
&chd=t:<?= $silly ?>,<?= $smart ?>
&cht=p3
&chl=Smart|Silly”
alt=”Sample chart” />
Ideal for web statistics…
3. More information about cool charts with the Google Chart Api you can find here: http://code.google.com/intl/en/apis/chart/types.html#pie_charts
4. And, its also possible to highlight countries on a map
No Comments yet
Be the first to write a comment