Vertical Graphs

[Total: 0    Average: 0/5]

This displays a vertical bar graph.

Body Code:

<script>
border=1
width=30
n_bars=9
function bar(high,val){
document.write("<td valign=bottom>",high,
   "<table bgcolor=#aa2222 border=",border," height=",high,
   " width=",width,
   " cellpadding=0 cellspacing=0>",
   "<tr><td align=center valign=bottom>",
   "<font color=#00000 size=-1 >",val,"</font>",
   "</td></tr></table></td>")
}

document.writeln("<br> parameters:");
document.writeln("<b>border= </b>",border," ");
document.writeln("<b>width= </b>",width,"<br><hr>");
document.writeln("<table bgcolor=#a0a0a0 height=200 width=",
 n_bars*width," border=",border," >");
//make Netscape 2.0 happy, without surrounding table, the bars are verticaly tiled 
//and without a border there is only text shown
bar(100,1);
bar(110,2);
bar(140,3);
bar(180,4);
bar(240,5);
bar(170,6);
bar( 80,7);
bar( 40,8);
bar(150,9);
document.writeln("</table>");
</script>

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *