Google Bar Charts

I just learned today from Joshua that Google Charts added an option to automatically compute bar widths and gaps for bar (or column) charts.  Doing it manually is always a total PITA, and I've intentionally chosen line chart where a bar chart was a better fit for that precise reason.  Now, however, you just set the 'chbh' parameter to 'a' and you're done.  Here's an example:

http://chart.apis.google.com/chart?
cht=bvg&chbh=a&chd=s:vttusty&chs=500x300
&chxt=x,y&chxl=0:|Sun|Mon|Tue|Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12

For the curious among you, that's the average number of hours I spend in bed for each day of the week.  Along with sleep, that typically includes some sudoku in the evening and checking my email in the morning.

5 responses to “Google Bar Charts”

  1. Dodo

    So this is for programmers not the average Joe or Jane. I'm not thrilled with Excel's charts but have one going to track the home loan interest rate trend. It's going down again so it may be time to secure a loan.

  2. duncan

    Strangely the barchart image is failing to show up for me in Firefox 3, even when I paste the address into the address bar. Instead I get a 500 x 300 white png file. It's fine in IE 6.

  3. duncan

    you must be right, shift-refresh fixed it.