您正在使用IPV4(44.192.247.184)访问本站 您本次共访问本站 1 次
 用户名: 密 码: 验证码:     用QQ登录本站
首页 软件 编程 笑话 知识 公告 台风 日历 计算器
[公益]文明驾车我带头,文明行路我带头,礼貌让座我带头       悟空收录网      

【腾讯云】云服务器等爆品抢先购,低至4.2元/月      
[公益] 节省一分零钱 献出一份爱心 温暖世间真情      
2023年 元宵节 4
2023年 情人节 13
2024年 元 旦 334
2024年 春 节 374
 
您现在的位置:首页 >> ASP/ASP.net >> 内容
本类新增
本类热门文章
ASP如何生成三维饼图
内容摘要: %'参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位)functiontable2(stat_array,table_left,table_top,all_width,all_height,table_title,unit)dimbg_color(10),pie(10)bg_color(1)='#ff1919'bg_color(2)='......
<%

'参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位)

functiontable2(stat_array,table_left,table_top,all_width,all_height,table_title,unit)

dimbg_color(10),pie(10)

bg_color(1)="#ff1919"

bg_color(2)="#ffff19"

bg_color(3)="#1919ff"

bg_color(4)="#19ff19"

bg_color(5)="#fc0"

bg_color(6)="#3cc"

bg_color(7)="#ff19ff"

bg_color(8)="#993300"

bg_color(9)="#f60"

bg_color(10)="#ff8c19"

num=ubound(stat_array,1)

allvalues=0

fori=1tonum

allvalues=allvalues+stat_array(i,1)

next

k=0

fori=1tonum-1

pie(i)=formatnumber(stat_array(i,1)/allvalues,4,-1)

k=k+pie(i)

next

pie(num)=formatnumber((1-k),4,-1)

response.Write"<v:shapetypeid='Cake_3D'coordsize='21600,21600'o:spt='95'adj='11796480,5400'path='al10800,[email protected]@[email protected]@14,10800,10800,10800,[email protected]@15xe'></v:shapetype>"

response.Write"<v:shapetypeid='3dtxt'coordsize='21600,21600'o:[email protected],[email protected],[email protected],[email protected],21600e'>"

response.Write"<v:pathtextpathok='t'o:connecttype='custom'o:[email protected],0;@10,10800;@11,21600;@12,10800'o:connectangles='270,180,90,0'/>"

response.Write"<v:textpathon='t'fitshape='t'/>"

response.Write"<o:lockv:ext='edit'text='t'shapetype='t'/>"

response.Write"</v:shapetype>"

response.Write"<v:rectid='background'style='position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;'fillcolor='#EFEFEF'strokecolor='gray'>"

response.Write"<v:shadowon='t'type='single'color='silver'offset='4pt,4pt'/>"

response.Write"</v:rect>"

response.Write"<v:groupID='table'style='position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;'coordsize='21000,11500'>"

response.Write"<v:Rectstyle='position:relative;left:500;top:200;width:20000;height:800'filled='false'stroked='false'>"

response.Write"<v:TextBoxinset='0pt,0pt,0pt,0pt'>"

response.Write"<tablewidth='100%'border='0'align='center'cellspacing='0'>"

response.Write"<tr>"

response.Write"<tdalign='center'valign='middle'><divstyle='font-size:15pt;font-family:黑体;'><B>"&table_title&"</B></div></td>"

response.Write"</tr>"

response.Write"</table>"

response.Write"</v:TextBox>"

response.Write"</v:Rect>"

response.Write"<v:rectid='back'style='position:relative;left:500;top:1000;width:20000;height:10000;'onmouseover='movereset(1)'onmouseout='movereset(0)'fillcolor='#9cf'strokecolor='#888888'>"

response.Write"<v:fillrotate='t'angle='-45'focus='100%'type='gradient'/>"

response.Write"</v:rect>"

response.Write"<v:rectid='back'style='position:relative;left:15000;top:1400;width:5000;height:"&((num+1)*9000/11+200)&";'fillcolor='#9cf'stroked='t'strokecolor='#0099ff'>"

response.Write"<v:fillrotate='t'angle='-175'focus='100%'type='gradient'/>"

response.Write"<v:shadowon='t'type='single'color='silver'offset='3pt,3pt'/>"

response.Write"</v:rect>"

response.Write"<v:Rectstyle='position:relative;left:15500;top:1500;width:4000;height:700'fillcolor='#000000'stroked='f'strokecolor='#000000'>"

response.Write"<v:TextBoxinset='8pt,4pt,3pt,3pt'style='font-size:11pt;'><divalign='left'><fontcolor='#ffffff'><B>总数:"&allvalues&unit&"</B></font></div></v:TextBox>"

response.Write"</v:Rect>"

fori=1tonum

response.Write"<v:Rectid='rec"&i&"'style='position:relative;left:15400;top:"&i*9000/11+1450&";width:4300;height:800;display:none'fillcolor='#efefef'strokecolor='"&bg_color(i)&"'>"

response.Write"<v:fillopacity='.6'color2='filldarken(118)'o:opacity2='.6'rotate='t'method='linearsigma'focus='100%'type='gradient'/>"

response.Write"</v:Rect>"

response.Write"<v:Rectstyle='position:relative;left:15500;top:"&i*9000/11+1500&";width:600;height:700'fillcolor='"&bg_color(i)&"'stroked='f'/>"

response.Write"<v:Rectstyle='position:relative;left:16300;top:"&i*9000/11+1500&";width:3400;height:700'filled='f'stroked='f'>"

response.Write"<v:TextBoxinset='0pt,5pt,0pt,0pt'style='font-size:9pt;'><divalign='left'>"&stat_array(i,2)&":"&stat_array(i,1)&unit&"</div></v:TextBox>"

response.Write"</v:Rect>"

next

response.Write"</v:group>"

k1=180

k4=10

fori=1tonum

response.write"<ahref=aaa.asp>"

k2=360*pie(i)/2

k3=k1+k2

ifk3>=360then

k3=k3-360

endif

kkk=(-11796480*pie(i)+5898240)

k5=3.1414926*2*(180-(k3-180))/360

R=all_height/2

txt_x=table_left+all_height/8-30+R+R*sin(k5)*0.7

txt_y=table_top+all_height/14-39+R+R*cos(k5)*0.7*0.5

titlestr="名称:"&stat_array(i,2)&"数值:"&stat_array(i,1)&unit&"所占比例:"&pie(i)*100&"%"

response.Write"<divstyle='cursor:hand;'>"

response.Write"<v:shapeid='cake"&i&"'type='#Cake_3D'title='"&titlestr&"'"

response.Write"style='position:absolute;left:"&table_left+all_height/8&"px;top:"&table_top+all_height/14&"px;WIDTH:"&all_height&"px;HEIGHT:"&all_height&"px;rotation:"&k3&";z-index:"&k4&"'"

response.Write"adj='"&kkk&",0'fillcolor='"&bg_color(i)&"'onmouseover='moveup(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&")';onmouseout='movedown(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&");'>"

response.Write"<v:fillopacity='60293f'color2='filllighten(120)'o:opacity2='60293f'rotate='t'angle='-135'method='linearsigma'focus='100%'type='gradient'/>"

response.Write"<o:extrusionv:ext='view'on='t'backdepth='25'rotationangle='60'viewpoint='0,0'viewpointorigin='0,0'skewamt='0'lightposition='-50000,-50000'lightposition2='50000'/>"

response.Write"</v:shape>"

response.Write"<v:shapeid='txt"&i&"'type='#3dtxt'style='position:absolute;left:"&txt_x&"px;top:"&txt_y&"px;z-index:20;display:none;width:50;height:18;'fillcolor='#ffffff'"

response.Write"onmouseover='ontxt(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&")'>"

response.Write"<v:fillopacity='60293f'color2='filllighten(120)'o:opacity2='60293f'rotate='t'angle='-135'method='linearsigma'focus='100%'type='gradient'/>"

response.Write"<v:textpathstyle='font-family:'宋体';v-text-kern:t'trim='t'fitpath='t'string='"&pie(i)*100&"%'/>"

response.Write"<o:extrusionv:ext='view'backdepth='8pt'on='t'lightposition='0,0'lightposition2='0,0'/>"

response.Write"</v:shape>"

response.Write"</div>"

k1=k1+k2*2

ifk1>=360then

k1=k1-360

endif

ifk1>180then

k4=k4+1

else

k4=k4-1

endif

response.write"</a>"

next

endfunction

%>

<htmlxmlns:v="urn:schemas-microsoft-com:vml"xmlns:o="urn:schemas-microsoft-com:office:office">

<head>

<title></title>

<STYLE>

v\:*{Behavior:url(#default#VML)}

o\:*{behavior:url(#default#VML)}

</STYLE>

</head>

<body>

<SCRIPTLANGUAGE="JavaScript">

<!--

onit=true

num=0

functionmoveup(iteam,top,txt,rec){

temp=eval(iteam)

tempat=eval(top)

temptxt=eval(txt)

temprec=eval(rec)

at=parseInt(temp.style.top)

temprec.style.display="";

if(num>27){

temptxt.style.display="";

}

if(at>(tempat-28)&&onit){

num++

temp.style.top=at-1

Stop=setTimeout("moveup(temp,tempat,temptxt,temprec)",10)

}else{

return

}

}

functionmovedown(iteam,top,txt,rec){

temp=eval(iteam)

temptxt=eval(txt)

temprec=eval(rec)

clearTimeout(Stop)

temp.style.top=top

num=0

temptxt.style.display="none";

temprec.style.display="none";

}

functionontxt(iteam,top,txt,rec){

temp=eval(iteam);

temptxt=eval(txt);

temprec=eval(rec)

if(onit){

temp.style.top=top-28;

temptxt.style.display="";

temprec.style.display="";

}

}

functionmovereset(over){

if(over==1){

onit=false

}else{

onit=true

}

}

-->

</script>

<%

dimtotal(10,2)

total(1,1)=2000

total(2,1)=1800

total(3,1)=1700

total(4,1)=1500

total(5,1)=1222

total(6,1)=1100

total(7,1)=1000

total(8,1)=800

total(9,1)=700

total(10,1)=600

total(1,2)="项目1"

total(2,2)="项目2"

total(3,2)="项目3"

total(4,2)="项目4"

total(5,2)="项目5"

total(6,2)="项目6"

total(7,2)="项目7"

total(8,2)="项目8"

total(9,2)="项目9"

total(10,2)="项目10"

calltable2(total,120,20,900,500,"三维饼状图","元")

'参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位)

%>

版权声明:本内容来源于网络,如有侵犯您的版权,请联系站长,本站收到您的信息后将及时处理。
上一篇:非常好用的asp备份,还原SQL数据库的 下一篇:ASP随机生成字符串的方法
发布日期:2023/1/17
手机扫二维码直达本页
发布时间:15:07:38
点  击:35
录  入:壹家怡园
相关文章
Baidu

YiJiaCMS 6.3.5.220928(MSSQL) 闽ICP备05000814号-1
本空间由腾讯云(轻量应用服务器)提供,百度云加速提供加速防护
Copyright©2000-2023