Farebeny stlpcovy graf (1)

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

141
p141.html / p141.zip
Na zaklade zadanych udajov zostavi stlpcovy graf
5402b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<HTML> <HEAD> <TITLE> JavaScript DESTINATION - P141 </TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function getHplot(){ n=new initArray(0,0,0,0,0,0) v=new initArray(0,0,0,0,0,0) title=document.isnform.title.value; stitle=document.isnform.stitle.value; document.write('<TABLE BORDER=0 WIDTH=486><TR><TD ' +'COLSPAN=3 ALIGN=CENTER><B>Horizontalny graf</' +'B></TD></TR><TR><TD COLSPAN=3 ALIGN=CENTER><B>' +title+'</B><BR><I>'+stitle+'</I></TD></TR>'); v[0]=document.isnform.v1.value; v[1]=document.isnform.v2.value; v[2]=document.isnform.v3.value; v[3]=document.isnform.v4.value; v[4]=document.isnform.v5.value; v[5]=document.isnform.v6.value; n[9]=0; n[6]=0; n[7]=0; for (var i=0;i<6;i++){ if (v[i].length>n[9]){ n[9]=v[i].length; } str=v[i] StringToNumber(); n[i]=num; if (n[i]<0){ n[i]=0; } n[6]+=n[i]; if (n[i]>n[7]){ n[7]=n[i]; } } n[10]=(n[9]+6)*8 n[8]=n[7]/(484-n[10]); document.write('<TR><TD><B>'+document.isnform.n1.value +'</B></TD><TD><IMG SRC="images/a2.gif" HEIGHT=10 WIDTH=' +(n[0]/n[8])+' BORDER=1></TD><TD>'+v[0]+'</TD></TR>' +'<TR><TD><B>'+document.isnform.n2.value +'</B></TD><TD><IMG SRC="images/b.gif" HEIGHT=10 WIDTH='+(n[1]/n[8]) +' BORDER=1></TD><TD>'+v[1]+'</TD></TR>' +'<TR><TD><B>'+document.isnform.n3.value +'</B></TD><TD><IMG SRC="images/c.gif" HEIGHT=10 WIDTH='+(n[2]/n[8]) +' BORDER=1></TD><TD>'+v[2]+'</TD></TR>' +'<TR><TD><B>'+document.isnform.n4.value +'</B></TD><TD><IMG SRC="images/d.gif" HEIGHT=10 WIDTH='+(n[3]/n[8]) +' BORDER=1></TD><TD>'+v[3]+'</TD></TR>' +'<TR><TD><B>'+document.isnform.n5.value +'</B></TD><TD><IMG SRC="images/e2.gif" HEIGHT=10 WIDTH='+(n[4]/n[8]) +' BORDER=1></TD><TD>'+v[4]+'</TD></TR>' +'<TR><TD><B>'+document.isnform.n6.value +'</B></TD><TD><IMG SRC="images/a2.gif" HEIGHT=10 WIDTH='+(n[5]/n[8]) +' BORDER=1></TD><TD>'+v[5]+'</TD></TR>'); document.write('<TR><TD COLSPAN=3><HR NOSHADE></TD></TR></TABLE>'); getVplot(); } function getVplot(){ n[8]=n[7]/100; document.write('<P><TABLE BORDER=0 WIDTH=486><TR><TD' +' COLSPAN=6 ALIGN=CENTER><B>Vertikalny graf</B></TD></TR>' +'<TR><TD COLSPAN=6 ALIGN=CENTER><B>' +title+'</B><BR><I>'+stitle+'</I></TD></TR><TR>' +'<TD VALIGN=BOTTOM ALIGN=CENTER><IMG SRC="images/a2.gif" HEIGHT=' +(n[0]/n[8]) +' WIDTH=50 BORDER=1></TD>' +'<TD VALIGN=BOTTOM ALIGN=CENTER><IMG SRC="images/b.gif" HEIGHT=' +(n[1]/n[8])+' WIDTH=50 BORDER=1></TD>' +'<TD VALIGN=BOTTOM ALIGN=CENTER><IMG SRC="images/c.gif" HEIGHT=' +(n[2]/n[8])+' WIDTH=50 BORDER=1></TD>' +'<TD VALIGN=BOTTOM ALIGN=CENTER><IMG SRC="images/d.gif" HEIGHT=' +(n[3]/n[8])+' WIDTH=50 BORDER=1></TD>' +'<TD VALIGN=BOTTOM ALIGN=CENTER><IMG SRC="images/e2.gif" HEIGHT=' +(n[4]/n[8])+' WIDTH=50 BORDER=1></TD>' +'<TD VALIGN=BOTTOM ALIGN=CENTER><IMG SRC="images/a2.gif" HEIGHT=' +(n[5]/n[8])+' WIDTH=50 BORDER=1></TD></TR><TR>' +'<TD ALIGN=CENTER><B>'+document.isnform.n1.value+'</B></TD>' +'<TD ALIGN=CENTER><B>'+document.isnform.n2.value+'</B></TD>' +'<TD ALIGN=CENTER><B>'+document.isnform.n3.value+'</B></TD>' +'<TD ALIGN=CENTER><B>'+document.isnform.n4.value+'</B></TD>' +'<TD ALIGN=CENTER><B>'+document.isnform.n5.value+'</B></TD>' +'<TD ALIGN=CENTER><B>'+document.isnform.n6.value+'</B></TD></TR>' +'<TR><TD ALIGN=CENTER>'+v[0]+'</B></TD>' +'<TD ALIGN=CENTER>'+v[1]+'</TD>' +'<TD ALIGN=CENTER>'+v[2]+'</TD>' +'<TD ALIGN=CENTER>'+v[3]+'</TD>' +'<TD ALIGN=CENTER>'+v[4]+'</TD>' +'<TD ALIGN=CENTER>'+v[5]+'</TD></TR><TR><TD COLSPAN=6' +'><HR NOSHADE><P></TD></TR></TABLE>'); } var pwr=new initArray(1,2,3,4); pwr[0]=1; pwr[1]=10; pwr[2]=100; pwr[3]=1000; pwr[4]=10000; pwr[5]=100000; pwr[6]=1000000; pwr[7]=10000000; var ns="0123456789" var cr=""; var str=""; function StringToNumber(){ num=0; strl=str.length; for (var j=strl-1;j>-1;j--){ cr=str.substring(j,j+1); pos=ns.indexOf(cr); num+=pos*pwr[strl-j-1]; } } function initArray() { this.length=initArray.arguments.length; for (var i=0;i<this.length;i++) { this[i]=initArray.arguments[i]; } } // --> </SCRIPT> </HEAD> <BODY BGCOLOR="WHITE"> <CENTER> <FORM NAME='isnform'> <TABLE BORDER=0 WIDTH=486> <TR><TD ALIGN=CENTER COLSPAN=7>Titulok grafu: <INPUT TYPE='text' NAME='title' SIZE='40' VALUE='Pocet navstevnikov od 9.12!'> <BR>Legenda: <INPUT TYPE='text' NAME='stitle' SIZE='40' VALUE='(12 sep - 24 okt)'></TD></TR> <TR><TD>Hodnoty:</TD> <TD><INPUT TYPE='text' NAME='n1' SIZE='8' VALUE='12/9-19/9'></TD> <TD><INPUT TYPE='text' NAME='n2' SIZE='8' VALUE='19/9-26/9'></TD> <TD><INPUT TYPE='text' NAME='n3' SIZE='8' VALUE='26/9-03/10'></TD> <TD><INPUT TYPE='text' NAME='n4' SIZE='8' VALUE='03/10-10/10'></TD> <TD><INPUT TYPE='text' NAME='n5' SIZE='8' VALUE='10/10-17/10'></TD> <TD><INPUT TYPE='text' NAME='n6' SIZE='8' VALUE='17/10-24/10'></TD></TR> <TR><TD><BR>Graph Values: <TD><INPUT TYPE='text' NAME='v1' SIZE='8' VALUE=1958> <TD><INPUT TYPE='text' NAME='v2' SIZE='8' VALUE=2004> <TD><INPUT TYPE='text' NAME='v3' SIZE='8' VALUE=2147> <TD><INPUT TYPE='text' NAME='v4' SIZE='8' VALUE=2170> <TD><INPUT TYPE='text' NAME='v5' SIZE='8' VALUE=2180> <TD><INPUT TYPE='text' NAME='v6' SIZE='8' VALUE=2251> </TD></TR> </TABLE> </FORM> <SCRIPT LANGUAGE="JavaScript"> <!-- getHplot(); // --> </SCRIPT> </CENTER> </body> </HTML>
[ Navrat / BACK ]