By manipulating the height value of an image, it is possible to produce graphs and charts dynamically. This function takes the Y-axis value (h), scales it to fit a given height, and document.writes it into a table cell in the specified color (c).
var graph="<img src='rollover/" +c+ ".gif' width='20'
It is called from within the cell like this drawBar(450,"red");
The individual bars are small GIF files in various colors. The next page shows a very basic application of the technique that only draws the bars. With a little more work, it would be possible to draw the whole graph including the title, the axis values and to vary the bar widths and spacing You could also do horizontal bars by varying the width of the GIFs instead of the height. See this in action on the survey stats page.