3Dパイチャート関数の生成を容易にするために、機能のコードを収集して、ASPの下で3Dパイチャートを生成しました。これは、誰もが特別な状況で使用するのに便利です。
<%
'パラメーターの意味(配列、水平座標、垂直座標、チャート幅、チャートの高さ、チャートタイトル、ユニット)
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 = ubund(stat_array、1)
すべての値= 0
fori = 1tonum
allvalues = allvalues+stat_array(i、1)
次
k = 0
fori = 1tonum-1
pie(i)= formatnumber(stat_array(i、1)/allvalues、4、-1)
k = k+pie(i)
次
pie(num)= formatnumber((1-k)、4、-1)
respons.write "<v:shapetypeid = 'cake_3d'coordsize =' 21600,21600'o:spt = '95'adj =' 11796480,5400'path = 'al10800,10800@0@0@2@2@14,10800,10800,10800,10800,10800,10800,10800
respons.write "<v:shapeTypeId = '3DTXT'COORDSIZE =' 21600,21600'O:spt = '136'adj =' 10800'path = 'm@7、l@8、m@5,21600L@6,21600e'>"
respons.write "<v:pathtextpathok = 't'o:connectType =' custom'o:connectlocs = '@9,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>"
respons.write "<v:rectid = 'background'style =' position:absolute; left:"&table_left& "px; top:"&table_top& "px; width:"&all_width& "px; height:"&all_height& "px; 'fillcolor ='
Response.Write "<v:Shadohon = '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; 'coordsizezize =' 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>"
respons.write "<tdalign = 'center'valign =' middle '> <divstyle =' font-size:15pt; font-family:bold; '> <b>"&table_title& "</b> </div> </td>"
Response.Write "</tr>"
Response.Write "</table>"
Response.Write "</v:textbox>"
Response.Write "</v:rect>"
Respons.Write "<v:rectid = 'back'style =' position:reartive; left:500; top:1000; width:20000; height:10000; 'onmouseter =' movereset(1) 'onmouseout =' movereset(0) 'fillcolor ='#9cf'strokolor = '#88888'>
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 ='#009ff '>"
Response.Write "<v:fillrotate = 't'angle =' -175'focus = '100%' type = 'Gradient'/>"
Response.Write "<v:Shadohon = 't'type =' single'color = 'silver'offset =' 3pt、3pt '/>"
Response.Write "</v:rect>"
Response.Write "<V:RectStyle = 'position:retary; left:15500; top:1500; width:4000; height:700'fillcolor ='#000000'stroked = 'f'strokecolor ='#000000 '>"
respons.write "<v:textboxset = '8pt、4pt、3pt、3pt'style =' font-size:11pt; '> <divalign =' left '> <fontcolor ='#ffffff '> <b>"&allvalues&and& "</b> </font>
Response.Write "</v:rect>"
fori = 1tonum
respons.write "<v:rectid = 'rec"&i& "' style = 'position:' position:recarty; left:15400; top:"&i*9000/11+1450& "; width:4300; height:800; display:none'fillcolor = '#efef'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'fill =' f'stroked = 'f'>"
respons.write "<v:textboxset = '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>"
次
Response.Write "</v:Group>"
K1 = 180
K4 = 10
fori = 1tonum
Response.Write "<ahref = aaa.asp>"
K2 = 360*パイ(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 = "name:"&stat_array(i、2)& "value:"&stat_array(i、1)&unit& "percentage:"&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&" px; height: "&all_height&" px; Rotation: "&k3&"; z-index: "
respons.write "adj = '"&kkk& "、0'fillcolor ='"&bg_color(i)& "'onmouseover =' moveup(cake"&i& "、"&(table_top+all_height /14)& "、txt"&i& "、rec"&i& ") '; onmouseout =' moveown(cake"&i& "&("&(table_top+all_height/14)& "、txt"&i& "、rec&i&"); '> "
respons.write "<v:fillopacity = '60293f'color2 =' filllighten(120) 'o:opacity2 =' 60293f'rotate = 't'anger =' -135'method = 'linearsigma'focus =' 100% 'type =' gradient '/>"
respons.write "<o:extrusionv:ext = 'view'on =' t'backdepth = '25'rotationange =' 60'viewpoint = '0'viewpointorigin =' 0,0'skewamt = '0'lightposition =' -50000、-50000'lightposition2 = '50000'/>"
Response.Write "</v:Shape>"
respons.write "<v:shapeid = 'txt"&i& "' yty = '#3dtxt'style =' position:absolute; left:"&txt_x& "px; top:"&txt_y& "px; z-index:20; display:none; width:50; height:18; 'fillcolor ='#fffffff '" "
respons.write "onmouseover = 'ontxt(cake"&i& "、"&(table_top+all_height/14)& "、txt"&i& "、rec"&i& ")'>"
respons.write "<v:fillopacity = '60293f'color2 =' filllighten(120) 'o:opacity2 =' 60293f'rotate = 't'anger =' -135'method = 'linearsigma'focus =' 100% 'type =' gradient '/>"
respons.write "<v:textpathStyle = 'font-family:'安 '; v-text-kern:t'trim =' t'fitpath = 't'String ='"&pie(i)*100& "% '/>"
respons.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
それ以外
K4 = K4-1
endif
Response.Write "</a>"
次
エンド機能
%>
<htmlxmlns:v = "urn:schemas-microsoft-com:vml" xmlns:o = "urn:schemas-microsoft-com:office:office">
<head>
<title> </title>
<style>
v/:*{動作:url(#default#vml)}
o/:*{動作: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 = "";
}