請問如何把數据庫表里的數据動態顯示在圖表上

sammyxing 2007-11-04 10:32:51
cs是我新建的一個表,cs_prop是其中一個字段,我現在想要的結果是把字段cs_prop的數据動態的顯示在一個圖表上.例如 把cs_prop里的數据
A占10%
B: 20%
C: 30%
D: 40%
分別顯示在各自所占的圖層上,請問我該如何實現?


由于代碼太長,我就挑選重要的一部分,其中數据庫連接部分是我后來加上的,而圖表的制作用到javascript 和 VML

<%
set conn=server.createobject("adodb.connection")
conn.open application("constr_torus_dbf")

sql="select distinct cs_prop from cs"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>

<%
select_tmp = ""
do while not rs.eof
%>
<option value="<%=rs("cs_prop")%>"><%=rs("cs_prop")%></option>
<%
rs.movenext
loop
set rs=nothing
set conn=nothing
%>







<v:Rect id='rec1' style='position:relative;left:14700;top:2154.41176470588;width:5000;height:900;display:none' fillcolor='#efefef' strokecolor='#ff3399'> <v:fill opacity='.6' color2='fill darken(118)' o:opacity2='.6' rotate='t' method='linear sigma' focus='100%' type='gradient'/> </v:Rect> <v:Rect style='position:relative;left:14900;top:2319.41176470588;width:700;height:700' fillcolor='#ff3399' stroked='f'/> <v:Rect style='position:relative;left:15700;top:2319.41176470588;width:3900;height:700' filled='f' stroked='f'> <v:TextBox inset='0pt,2pt,0pt,0pt' style='font-size:10pt;'><div align='left'>TEAM A:5.26%</div></v:TextBox> </v:Rect>

<v:Rect id='rec9' style='position:relative;left:14700;top:8165;width:5000;height:900;display:none' fillcolor='#efefef' strokecolor='#9400d3'> <v:fill opacity='.6' color2='fill darken(118)' o:opacity2='.6' rotate='t' method='linear sigma' focus='100%' type='gradient'/> </v:Rect> <v:Rect style='position:relative;left:14900;top:8260;width:700;height:700' fillcolor='#9400d3' stroked='f'/> <v:Rect style='position:relative;left:15700;top:8260;width:3900;height:700' filled='f' stroked='f'> <v:TextBox inset='0pt,2pt,0pt,0pt' style='font-size:10pt;'><div align='left'>其他:19.84%</div></v:TextBox> </v:Rect> </v:group>


<div style='cursor:hand;'> <v:shape id='cake1' type='#Cake_3D' title=' 類  別:TEAM A  所占比例:5.26%  ' style='position:absolute;left:41.6666666666667px;top:6.41025641025641px;WIDTH:250px;HEIGHT:250px;rotation:191.268;z-index:10' adj='5159780.352,0' fillcolor='#ff3399' onmouseover='moveup(cake1,6.41025641025641,txt1,rec1)'; onmouseout='movedown(cake1,6.41025641025641,txt1,rec1);'> <v:fill opacity='60293f' color2='fill lighten(120)' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/> <o:extrusion v:ext='view' on='t'backdepth='25' rotationangle='60' viewpoint='0,0'viewpointorigin='0,0' skewamt='0' lightposition='-50000,-50000' lightposition2='50000'/> </v:shape> <v:shape id='txt1' type='#3dtxt' style='position:absolute;left:153.772078122357px;top:49.5043858942899px;z-index:15;display:none;width:65; height:24; onmouseover='ontxt(cake1,6.41025641025641,txt1,rec1)'> <v:fill opacity='60293f' color2='white' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/> <div><font size='-1'>TEAM A 5.26%</div> </v:shape> </div>


<div style='cursor:hand;'> <v:shape id='cake9' type='#Cake_3D' title=' 類  別:其他  所占比例:19.84%  ' style='position:absolute;left:41.6666666666667px;top:6.41025641025641px;WIDTH:250px;HEIGHT:250px;rotation:143.446;z-index:12' adj='3500493.056,0' fillcolor='#9400d3' onmouseover='moveup(cake9,6.41025641025641,txt9,rec9)'; onmouseout='movedown(cake9,6.41025641025641,txt9,rec9);'> <v:fill opacity='60293f' color2='fill lighten(120)' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/> <o:extrusion v:ext='view' on='t'backdepth='25' rotationangle='60' viewpoint='0,0'viewpointorigin='0,0' skewamt='0' lightposition='-50000,-50000' lightposition2='50000'/> </v:shape> <v:shape id='txt9' type='#3dtxt' style='position:absolute;left:79.7854302578758px;top:59.1658021937738px;z-index:15;display:none;width:65; height:24; onmouseover='ontxt(cake9,6.41025641025641,txt9,rec9)'> <v:fill opacity='60293f' color2='white' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/> <div><font size='-1'>其他 19.84%</div> </v:shape> </div>





...全文
80 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧