Para facilitar la generación de funciones de gráficos circulares 3D, he recopilado el código de la función para generar gráficos circulares 3D bajo ASP, lo cual es conveniente para que todos los usen en circunstancias especiales.
<%
'Significado del parámetro (matriz, coordenada horizontal, coordenada vertical, ancho del gráfico, altura del gráfico, título del gráfico, unidad)
Functable2 (stat_array, table_left, table_top, all_width, all_height, table_title, unidad)
dimbg_color (10), pastel (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)
Allvalues = 0
fori = 1tonum
allValues = allValues+stat_array (i, 1)
próximo
K = 0
fori = 1tonum-1
Pie (i) = FormatNumber (stat_array (i, 1)/Allvalues, 4, -1)
k = k+pastel (i)
próximo
Pie (num) = FormatNumber ((1-k), 4, -1)
Respuesta.Write "<V: ShapeTypeId = 'Cake_3d'coordSize =' 21600,21600'o: spt = '95'adj =' 11796480,5400'Path = 'Al10800,10800@0@2@14,10800,10800,10800,10800@3@15xe' <v: shapetype
Response.write "<v: shapeTypeId = '3dtxt'coordSize =' 21600,21600'o: spt = '136'adj =' 10800'path = 'm@7, l@8, m@5,21600l@6,21600e'>"
Response.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 = 'editText =' t'ShapeType = 't'/>"
Response.Write "</V: ShapeType>"
Respuesta.Write "<v: rectid = 'background'style =' posicion: absoluto; izquierda:" & table_left & "px; top:" & table_top & "px; width:" & all_width & "px; altura:" & all_height & "px; 'rellycolor ='#efefef'strokecolor = 'gris'>" "
Response.write "<v: shadowon = 't'type =' single'color = 'silver'offset =' 4pt, 4pt '/>"
Response.write "</v: rect>"
Respuesta.Write "<v: groupId = 'table'style =' Position: Absolute; izquierda:" & table_left & "px; top:" & table_top & "px; width:" & all_width & "px; Height:" & All_Height & "Px;" coordSize = '21000,11500'> "".
Respuesta.Write "<V: rectstyle = 'Posición: relativo; izquierda: 500; arriba: 200; ancho: 20000; altura: 800'Filled =' false'stroked = 'false'>"
Response.write "<v: textboxInset = '0pt, 0pt, 0pt, 0pt'>"
respuesta.write "<tableWidth = '100%' border = '0'align =' Center'CellSpacing = '0'>"
Response.Write "<tr>"
Response.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>"
Respuesta.write "<v: rectid = 'back'style =' posición: relativo; izquierda: 500; arriba: 1000; ancho: 20000; altura: 10000; 'onMouseOver =' MOvereset (1) 'OnMouseOut =' Movereset (0) 'FillColor ='#9CF'Strokecoloror = '#888888'>" "" "" "" "" "" "" "" ".
Response.write "<v: fillrotate = 't'angle ='-45'focus = '100%' type = 'gradiente'/>"
Response.write "</v: rect>"
Response.write "<V: rectid = 'back'style =' Position: Relativo; izquierda: 15000; arriba: 1400; ancho: 5000; altura:" & ((num+1)*9000/11+200) & "; 'relleno ='#9cf'stroked = 't'strokecolorin ='#0099ff '>"
Response.write "<v: fillrotate = 't'angle ='-175'focus = '100%' type = 'gradiente'/>"
Response.write "<v: shadowon = 't'type =' single'color = 'silver'offset =' 3pt, 3pt '/>"
Response.write "</v: rect>"
respuesta.write "<v: rectstyle = 'Posición: relativo; izquierda: 15500; arriba: 1500; ancho: 4000; altura: 700'FillColor ='#000000'stroked = 'f'Strokecolor ='#000000 '>"
Response.Write "<v: textBoxSet = '8pt, 4Pt, 3PT, 3PT'Style =' Font-size: 11pt; '> <divalign =' izquierda '> <fontcolor ='#ffffff '> <b> Total:" & AllValues & Unit & "</b> </font> </div> </v: TextBox>"
Response.write "</v: rect>"
fori = 1tonum
Response.write "<v: rectid = 'rec" & i & "' style = 'posición: relativo; izquierda: 15400; arriba:" & i*9000/11+1450 & "; ancho: 4300; altura: 800; display: none'fillColor ='#efefef'strokecolor = '" & bg_color (i) & "'>"> ""> "" ">"
Respuesta.Write "<V: Fillopacity = '. 6'Color2 =' Filldarken (118) 'O: Opacity2 ='. 6'Rotate = 'T'method =' LinearSigma'focus = '100%' Type = 'Gradient'/>"
Response.write "</v: rect>"
Respuesta.Write "<V: rectstyle = 'Posición: relativa; izquierda: 15500; arriba:" & i*9000/11+1500 & "; ancho: 600; altura: 700'fillcolor ='" & bg_color (i) & "'stroked =' f '/>"/> "
Respuesta.Write "<V: rectStyle = 'Posición: relativo; izquierda: 16300; arriba:" & i*9000/11+1500 & "; ancho: 3400; altura: 700'Filled =' f'stroked = 'f'>"
Respuesta.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>"
próximo
Response.Write "</V: Group>"
K1 = 180
K4 = 10
fori = 1tonum
respuesta.write "<ahref = aaa.asp>"
k2 = 360*pastel (i)/2
K3 = K1+K2
ifk3> = 360THEN
K3 = K3-360
endif
kkk = (-11796480*pastel (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 = "Nombre:" & STAT_Array (i, 2) y "Valor:" & STAT_Array (i, 1) & Unit & "Porcentaje:" & PIE (i)*100 & "%"
Response.write "<divstyle = 'cursor: hand;'>"
Response.write "<v: shapeID = 'Cake" & i & "' type = '#Cake_3d'title ='" & Titlestr & "'"
Respuesta.Write "Style = 'Position: Absolute; Left:" & table_left+all_height/8 & "px; top:" & table_top+all_height/14 & "px; width:" & all_height & "px; altura:" & All_height & "px; rotación:" & k3 & "; z-hindex:" & k4 & "" "" "" "" "" "" "" "" "" "" "" ".
Response.Write "adj = '" & kkk & ", 0'FillColor ='" & bg_color (i) & "'onMouseOver =' MoveUp (pastel" & i & "," & (table_top+all_height /14) & ", txt" & i & ", rec" & i & ") '; onMouseOut =' Moventown (pastel" & i & "," & (table_top+all_height/14) & ", txt" & i & ", rec" & i & "); '>"
Respuesta.Write "<V: Fillopacity = '60293f'Color2 =' Filllighten (120) 'O: Opacity2 =' 60293f'rotate = 't'angle ='-135'method = 'LinearSigma'Focus =' 100%'Tipo =' Gradiente '/>"
Response.Write "<o: extrusionV: ext = 'view'on =' t'backdepth = '25'rotationAngle =' 60'ViewPoint = '0,0'ViewPointOrigin =' 0,0'Skewamt = '0'lightPosition ='-50000, -50000'lightPosition2 = '5000000'/>"
Response.write "</v: Shape>"
Response.write "<v: shapeID = 'txt" & i & "' type = '#3dtxt'Style =' Position: Absolute; Left:" & txt_x & "px; top:" & txt_y & "px; z-odex: 20; visual
Response.write "onMouseOver = 'Ontxt (Cake" & i & "," & (table_top+all_height/14) & ", txt" & i & ", rec" & i & ")'>"
Respuesta.Write "<V: Fillopacity = '60293f'Color2 =' Filllighten (120) 'O: Opacity2 =' 60293f'rotate = 't'angle ='-135'method = 'LinearSigma'Focus =' 100%'Tipo =' Gradiente '/>"
Response.Write "<V: TextPathStyle = 'Font-Family:' 安 '; V-text-kern: t'trim =' t'fitPath = 't'string ='" & PIE (i)*100 & "%'/>"
Respuesta.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
demás
K4 = K4-1
endif
Response.write "</a>"
próximo
Función final
%>
<htmlxmlns: v = "urn: schemas-microsoft-com: vml" xmlns: o = "urn: schemas-microsoft-com: oficina: oficina">
<Evista>
<title> </title>
<Estilo>
v/:*{comportamiento: url (#predeterminado#vml)}
o/:*{comportamiento: url (#predeterminado#vml)}
</style>
</ablo>
<Body>
<ScriptLanguage = "javaScript">
<!-
onit = verdadero
num = 0
functionMoveUp (Iteam, Top, Txt, Rec) {
temp = eval (iteam)
tempat = eval (arriba)
temptxt = eval (txt)
Temprec = eval (rec)
AT = parseint (temp.style.top)
Temprec.style.display = "";
if (num> 27) {
temptxt.style.display = "";
}