»
EnglishFrenchVietnamese

Print - Bar Chart - JavaScriptBank.com

Full version: jsB@nk » Graphic » Bar Chart
URL: https://www.javascriptbank.com/bar-chart.html

Bar Chart © JavaScriptBank.comThe effect will display the colorful charts with the random parameters.

Full version: jsB@nk » Graphic » Bar Chart
URL: https://www.javascriptbank.com/bar-chart.html



JavaScript
<SCRIPT language=JavaScript>function displayTitle( title ){   document.write("<center><i>" + title + "</i></center><br>");}function generateRandomNumber(num) {  return Math.round( Math.random() * (num - 1) ) + 1;}function plottablehead(  val ){   document.writeln("<table border = 0 bgcolor = black width = 10 height = 10 cellpadding = 0 cellspacing = 0>");   document.write("<tr> <i>" + val + "</i>");}function plottabletail(){  document.write("</tr></table><br>");}function plotcolor(d, clr){    for(i=1;i<=d;i++){ document.write("<td bgcolor = " + clr + ">&nbsp;&nbsp;&nbsp;</td>");}}function setColor(foreground,background){document.fgColor=foreground;document.bgColor=background;}//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<script>/*setColor("orange","black");displayTitle("Bar Graph By Shaji");*/a=generateRandomNumber(50);plottablehead( a );plotcolor(a, "red");plottabletail();a=generateRandomNumber(50);plottablehead( a );plotcolor(a, "blue");plottabletail();a=generateRandomNumber(50);plottablehead( a );plotcolor(a, "green");plottabletail();a=generateRandomNumber(50);plottablehead( a );plotcolor(a, "yellow");plottabletail();a=generateRandomNumber(50);plottablehead( a );plotcolor(a, "gray");plottabletail();a=generateRandomNumber(50);plottablehead( a );plotcolor(a, "midnightblue");plottabletail();//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->