Back to Scripts page
Click in the text area below, select all and copy to grab the script
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd"> <HTML> <HEAD> <TITLE>Bar Chart</TITLE> </HEAD> <FRAMESET COLS="150,*"> <FRAME SRC="input.html" NAME="left"> <FRAME SRC="barchart.html" NAME="right"> </FRAMESET> </HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <TITLE>Bar Chart Form Input</TITLE> <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"> <!-- Hide code from older browsers chartType = "browser" colorVal = "lilRed.gif" chartDirection = "" function chgChart() { if (chartType == "browser") { headName = new Array ("Browser usage by year","1998","1999","2000","2001") array1 = new Array ("Netscape",38.9,31.9,21.2,12.4) array2 = new Array ("MSIE",60.6,67.4,78.3,85.6) array3 = new Array ("Other",0.5,0.5,0.5,2.1) } else { headName = new Array ("JavaScript usage by year","1998","1999","2000","2001") array1 = new Array ("1.2 or later",63.4,66.5,78.4,80.2) array2 = new Array ("1.0 - 1.1",18.7,12.6,2.8,0.8) array3 = new Array ("No JavaScript",17.9,21.0,18.8,19.0) } arrayArray = new Array(array1,array2,array3) arrayLength = headName.length parent.right.location.reload() } // Stop hiding code --> </SCRIPT> </HEAD> <BODY BGCOLOR="WHITE"> <FORM NAME="chartForm"> Choose a chart<BR> <INPUT TYPE="RADIO" NAME="Type" VALUE="browser" onClick="chartType=this.value;chgChart()" CHECKED> Browser Usage<BR> <INPUT TYPE="RADIO" NAME="Type" VALUE="platform" onClick="chartType=this.value;chgChart()"> JavaScript Usage<BR> <P><BR></P> Choose a color<BR> <INPUT TYPE="RADIO" NAME="Color" VALUE="lilRed.gif" onClick="colorVal=this.value;chgChart()" CHECKED> Red<BR> <INPUT TYPE="RADIO" NAME="Color" VALUE="lilGreen.gif" onClick="colorVal=this.value;chgChart()"> Green<BR> <INPUT TYPE="RADIO" NAME="Color" VALUE="lilBlue.gif" onClick="colorVal=this.value;chgChart()"> Blue<BR> <P><BR></P> Choose a direction<BR> <INPUT TYPE="RADIO" NAME="Direction" VALUE="horizontal" onClick="chartDirection=this.value;chgChart()" CHECKED> Horizontal<BR> <INPUT TYPE="RADIO" NAME="Direction" VALUE="vertical" onClick="chartDirection=this.value;chgChart()"> Vertical </FORM> </BODY> </HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <TITLE>Bar Chart</TITLE> <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"> <!-- Hide code from older browsers if (parent.left.chartDirection=="") { parent.left.chartDirection="horizontal" parent.left.chgChart() } // Stop hiding code --> </SCRIPT> </HEAD> <BODY BGCOLOR="WHITE"> <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"> <!-- Hide code from older browsers document.write("<H2>"+parent.left.headName[0]+"<\/H2><TABLE>") for (j=1;j<parent.left.arrayLength;j++) { if (parent.left.chartDirection=="horizontal") { document.write("<TR><TD COLSPAN='2'><P><BR><\/P><H3>"+parent.left.headName[j]+"<\/H3><\/TD><\/TR>") for (i=0;i<parent.left.arrayArray.length;i++) { document.write("<TR><TD>"+parent.left.arrayArray[i][0]+"<\/TD><TD>") document.write("<IMG SRC='"+parent.left.colorVal+"' HEIGHT='15' WIDTH='"+(parent.left.arrayArray[i][j]*3)+"'>") document.write(" "+parent.left.arrayArray[i][j]+"<\/TD><\/TR>") } } else { document.write("<TR><TD COLSPAN='"+(parent.left.arrayLength-1)+"'><P><BR><\/P><H3>") document.write(parent.left.headName[j]+"<\/H3><\/TD><\/TR><TR VALIGN='BOTTOM' ALIGN='CENTER'>") for (i=0;i<parent.left.arrayArray.length;i++) { document.write("<TD><IMG SRC='"+parent.left.colorVal+"' HSPACE='10' WIDTH='15' HEIGHT='"+(parent.left.arrayArray[i][j]*3)+"'><\/TD>") } document.write("<\/TR><TR ALIGN='CENTER'>") for (i=0;i<parent.left.arrayArray.length;i++) { document.write("<TD>" + parent.left.arrayArray[i][j] + "<BR>" + parent.left.arrayArray[i][0] + "<\/TD>") } document.write("<\/TR>") } } document.write("<\/TABLE>") // Stop hiding code --> </SCRIPT> </BODY> </HTML>
Images: (Some scripts do not have associated images)