制作柱状投票统计图的完整程序

来源:互联网 发布:数据透视表怎么合计 编辑:程序博客网 时间:2024/05/21 08:37
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

<!--以下便是完整的 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="阿里西西IT技术论坛">
<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>
</BODY>
</HTML>

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>