用纯ASP实现完美的WEB柱状图
WEB柱状图效果:% dim total(7,2) total(1,1)=200 total(2,1
WEB柱状图效果:
<%
dim total(7,2)
total(1,1)=200
total(2,1)=800
total(3,1)=1000
total(4,1)=600
total(5,1)=1222
total(6,1)=3213
total(7,1)=8
total(1,2)="中国经营报"
total(2,2)="招聘网"
total(3,2)="51Job"
total(4,2)="新民晚报"
total(5,2)="新闻晚报"
total(6,2)="南方周末"
total(7,2)="羊城晚报"
total_no=7
%>
<%call table1(total,20,15,470,200)%>
以上是调用函数的例子,下面是所调用的函数
<%
function table1(total,thickness,table_space,all_width,all_height)
'参数含义(传递的数组,柱子的厚度,柱子的间隔,图表的宽度,图表的高度)
'纯ASP代码生成图表函数1——柱状图
'作者:龚鸣(Passwordgm) QQ:25968152 MSN:passwordgm@sina.com Email:passwordgm@sina.com
'本人非常愿意和ASP,VML,FLASH的爱好者在HTTP://topclouds.126.com进行交流和探讨
'版本1.0 最后修改日期 2003-7-10
'非常感谢您使用这个函数,请您使用和转载时保留版权信息,这是对作者工作的最好的尊重。
dim tb_color(7,2)
tb_color(1,1)="#d1ffd1"
tb_color(2,1)="#ffbbbb"
tb_color(3,1)="#ffe3bb"
tb_color(4,1)="#cff4f3"
tb_color(5,1)="#d9d9e5"
tb_color(6,1)="#ffc7ab"
tb_color(7,1)="#ecffb7"
tb_color(1,2)="#00ff00"
tb_color(2,2)="#ff0000"
tb_color(3,2)="#ff9900"
tb_color(4,2)="#33cccc"
tb_color(5,2)="#666699"
tb_color(6,2)="#993300"
tb_color(7,2)="#99cc00"
response.write ""
response.write "" response.write "" response.write ""
temp1=0 for i=1 to total_no if temp1next temp1=int(temp1) if temp1>9 then temp2=mid(cstr(temp1),2,1) if temp2>4 then temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+1)*10^(len(cstr(temp1))-1) else temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+0.5)*10^(len(cstr(temp1))-1) end if else if temp1>4 then temp3=10 else temp3=5 end if if total_no>0 then for i=temp3 to 1 step -temp3/5 response.write " | | " response.write ""&i&" | " next response.write " " response.write " | 1 | " response.write " | " response.write " | | | " response.write " | | " response.write "" response.write ""
for i=1 to total_no response.write ""&total(i,2)&" | " next else response.write "" end if response.write " | |
"
end function
%> 本文作者:佚名 来源:http://www.tqts.net/
CIO之家 www.ciozj.com 微信公众号:imciow
版权声明:CIO之家尊重行业规范,每篇文章都注明有明确的作者和来源;CIO之家的原创文章,请转载时务必注明文章作者和来源;
延伸阅读