使用 Vml 製作立體柱狀投票統計圖的完整程式

來源:互聯網
上載者:User

 

 

 

作者:lshdic   http://blog.csdn.net/lshdic/

<!--以下便是完整的 Js+Vml 製作柱狀投票統計圖的完整程式,儲存為HTM檔案運行即可看到效果
其中 array數組中的分組可以為6個也可以為2,3,4,5個等,運行以下程式需要您的瀏覽器支援VML
改編為ASP檔案則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="網路程式員伴侶-Lshdic 2002">
<TITLE>藍麗民意調查</TITLE>
<STYLE>
td{font-size:12px}
body{font-size:12px}
v/:*{behavior:url(#default#VML);} //這裡聲明了v作為VML公用變數
</STYLE>
</HEAD>
<body bgcolor=eeeeee style='border:0 solid eeeeee'><center>共有<font color=red>69</font>人蔘與過投票<br>

<script>
array1=new Array(16,14,10,16,5,8) //不同的投票票數
allstr=array1[0]+array1[1]+array1[2]+array1[3]+array1[4]+array1[5] //得到總數
for(i=0;i<=5;i++){
mathstr=Math.round(100/(allstr/array1[i])) //求百分之幾, 100/(總和/單個)
document.write ("<v:rect fillcolor='lime' style='width:20;color:navy;height:"+5000/(1000/mathstr)+"'><br>&nbsp;%"+mathstr+"<br>"+array1[i]+"人<v:Extrusion backdepth='15pt' on='true'/></v:rect>")
}
</script>
<p>
<table width=190><Tr><Td>
增加新的欄目版塊</td><Td>16人</td></tr><tr><td>
完善娛樂視聽</td><Td>14人</td></tr><tr><td>
完善技術文章</td><Td>10人</td></tr><tr><td>
完善下載中心</td><Td>16人</td></tr><tr><td>
完善線上工具</td><Td>5人</td></tr><tr><td>
完善程式交流論壇</td><Td>8人</td></tr></table><p>
<a href='javascript:self.close()' style='text-Decoration:none;'>〖關閉視窗〗</a><p>
<A href='http://www.lshdic.com' target='_blank'>http://www.lshdic.com</a> Work by 02/12/01
</BODY>
</HTML>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.