ODBiC Discussion Board

RE: Bar and Pie charts, Jon Grosse, 10-26-2006

by David Richardson, November 4, 2006 09:15

To do pie charts you'll need to have an external programme that ODBScipt can pass variables to. While you can certainly perform the necessary mathematics in ODBScript, there's no way of outputting a circle as an image. At least none that I know of.

Barcharts on the other hand are a little bit easier. You can take a gif image and then stretch it to the desired length for your barchart, and then repeat for each row. A better way would probably be to do it with CSS and DIVs (though you would have to use inline styles to change the bar values dynamically).

So something like this would produce a horizontal barchart:

div.bar {background:blue; height: 10px}

<!--SELECT value from mytable order by value--> <!--EACHROW--> <div class="bar" style="width:$value$"></div> <!--ENDROW-->

Using CSS allows you to get really fancy with your bar charts using formatting for lists (unordered lists and definition lists can give you loads of options). Google "bar chart" +CSS for formatting ideas.

Hope that helps.


Post Your Reply:

E-mail  optional

HTTP Link: 
Link text: 


Copyright ©1997-2003, Roger Harris. All rights reserved.