asp 3 D円グラフを生成する関数
8732 ワード
3 D円グラフ関数の生成を容易にするために、aspの下で3 D円グラフを生成する関数のコードを収集して、みんなの特殊な情況の使用を便利にします
' ( , , , , , , )
function table2(stat_array,table_left,table_top,all_width,all_height,table_title,unit)
dim bg_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
for i=1 to num
allvalues = allvalues+stat_array(i,1)
next
k=0
for i=1 to num-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 ""
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write ""
response.Write " "
response.Write " "
response.Write ""
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "&table_title&"
"
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " :"&allvalues&unit&" "
response.Write " "
for i=1 to num
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "&stat_array(i,2)&":"&stat_array(i,1)&unit&" "
response.Write " "
next
response.Write " "
k1=180
k4=10
for i=1 to num
response.write ""
k2=360*pie(i)/2
k3=k1+k2
if k3>=360 then
k3=k3-360
end if
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 " "
response.Write " 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 " "
response.Write " "
response.Write " "
response.Write " response.Write " onmouseover='ontxt(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&")'>"
response.Write " "
response.Write " "
response.Write " "
response.Write " "
response.Write " "
k1=k1+k2*2
if k1>=360 then
k1=k1-360
end if
if k1>180 then
k4=k4+1
else
k4=k4-1
end if
response.write ""
next
end function
%>
<br/><style>
<br>v\:* { Behavior: url(#default#VML) }
<br>o\:* { behavior: url(#default#VML) }
<br></style>
<br/>
<br/>
<br/><script>
<br><!--
<br>onit=true
<br>num=0
<br>function moveup(iteam,top,txt,rec){
<br>temp=eval(iteam)
<br>tempat=eval(top)
<br>temptxt=eval(txt)
<br>temprec=eval(rec)
<br>at=parseInt(temp.style.top)
<br>temprec.style.display = "";
<br>if (num>27){
<br>temptxt.style.display = "";
<br>}
<br>if(at>(tempat-28)&&onit){
<br>num++
<br>temp.style.top=at-1
<br>Stop=setTimeout("moveup(temp,tempat,temptxt,temprec)",10)
<br>}else{
<br>return
<br>}
<br>}
<br>function movedown(iteam,top,txt,rec){
<br>temp=eval(iteam)
<br>temptxt=eval(txt)
<br>temprec=eval(rec)
<br>clearTimeout(Stop)
<br>temp.style.top=top
<br>num=0
<br>temptxt.style.display = "none";
<br>temprec.style.display = "none";
<br>}
<br>function ontxt(iteam,top,txt,rec){
<br>temp = eval(iteam);
<br>temptxt = eval(txt);
<br>temprec = eval(rec)
<br>if (onit){
<br>temp.style.top = top-28;
<br>temptxt.style.display = "";
<br>temprec.style.display = "";
<br>}
<br>}
<br>function movereset(over){
<br>if (over==1){
<br>onit=false
<br>}else{
<br>onit=true
<br>}
<br>}
<br>-->
<br></script>
<br/>dim total(10,2)
<br/>total(1,1)=2000
<br/>total(2,1)=1800
<br/>total(3,1)=1700
<br/>total(4,1)=1500
<br/>total(5,1)=1222
<br/>total(6,1)=1100
<br/>total(7,1)=1000
<br/>total(8,1)=800
<br/>total(9,1)=700
<br/>total(10,1)=600
<br/>total(1,2)=" 1"
<br/>total(2,2)=" 2"
<br/>total(3,2)=" 3"
<br/>total(4,2)=" 4"
<br/>total(5,2)=" 5"
<br/>total(6,2)=" 6"
<br/>total(7,2)=" 7"
<br/>total(8,2)=" 8"
<br/>total(9,2)=" 9"
<br/>total(10,2)=" 10"
<br/>call table2(total,120,20,900,500," "," ")
<br/>' ( , , , , , , )
<br/>%>
<br/>
</code></pre>
<div class="clearfix">
<span id="art_bot" class="jbTestPos"/>
</div>
</div>
</div>
</div>