Author: lshdic http://blog.csdn.net/lshdic/
<! -- The following is the complete program for creating a columnar voting Statistical Chart using JS + VML. Save it as an HTM file and run it to see the effect.
The array can contain 6 or 2, 4, and 5 groups. To run the following program, your browser must support VML.
New array (<% = RS (0) >,< % = RS (1) >,< % = RS (2)>, <% = RS (3) >,< % = RS (4) >,< % = RS (5)> ).
-->
<HTML xmlns: V>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Meta name = "generator" content = "Network programmer companion-lshdic 2002">
<Title> lanli public opinion survey </title>
<Style>
TD {font-size: 12px}
Body {font-size: 12px}
V/: * {behavior: URL (# default # VML);} // v is declared as a VML public variable.
</Style>
</Head>
<Body bgcolor = eeeeee style = 'border: 0 solid eeeeeeee '> <center> A total of <font color = Red> 69 </font> participants voted <br>
<SCRIPT>
Array1 = new array (16, 14, 10, 16, 5, 8) // different votes
Allstr = array1 [0] + array1 [1] + array1 [2] + array1 [3] + array1 [4] + array1 [5] // obtain the total number
For (I = 0; I <= 5; I ++ ){
Mathstr = math. Round (100/(allstr/array1 [I]) // calculate a few percent, 100/(sum/Single)
Document. write ("<v: rect fillcolor = 'lime 'style = 'width: 20; color: Navy; Height:" + 5000/(1000/mathstr) + "'> <br> & nbsp; %" + mathstr + "<br>" + array1 [I] + "person <V: extrusion backdepth = '15pt' on = 'true'/> </V: rect> ")
}
</SCRIPT>
<P>
<Table width = 190> <tr> <TD>
Add a new topic section </TD> <TD> 16 people </TD> </tr> <TD>
Improved entertainment and audio-visual </TD> <TD> 14 people </TD> </tr> <TD>
Improved technical articles </TD> <TD> 10 </TD> </tr> <TD>
Complete the download center </TD> <TD> 16 persons </TD> </tr> <TD>
Complete online tools </TD> <TD> 5 </TD> </tr> <TD>
Improved Program Communication Forum </TD> <TD> 8 persons </TD> </tr> </table> <p>
<A href = 'javascript: Self. Close () 'style = 'text-Decoration: none;'> Close Window </a> <p>
<A href = 'HTTP: // www.lshdic.com 'target =' _ blank '> http://www.lshdic.com </a> work by 02/12/01
</Body>
</Html>