欢迎光临
我们一直在努力

用ASP生成Chart (二维饼图)

建站超值云服务器,限时71元/月

这是使用activex controls 的

<%@ language=vbscript %>

<html>

<head>

<meta name="generator" content="microsoft visual studio 6.0">

</head>

<body>

<object classid="clsid:3a2b370c-ba0a-11d1-b137-0000f8753f5d"

id=mschart1 style="left: 0px; top: 0px" viewastext height=300 width=300></object>

<script language="vbscript">

<%

set objconn = server.createobject("adodb.connection")

objconn.connectionstring = "dsn=advworks"

objconn.open

set objrs = server.createobject("adodb.recordset")

objrs.activeconnection = objconn

objrs.cursorlocation = 3

objrs.open("select orderdetailid,unitprice from order_details")

i=1

response.write "const num = " & objrs.recordcount & vbcr

response.write "dim id(" & objrs.recordcount & ")" & vbcr

response.write "dim details(" & objrs.recordcount & ")" & vbcr

do while not objrs.eof

response.write("id(" & i & ")=""" & objrs(0) & """" & chr(13))

response.write("details(" & i & ")=""" & objrs(1) & """" & chr(13))

i=i+1

objrs.movenext

loop

%>

mschart1.titletext = "example"

mschart1.rowcount = 1

mschart1.columncount = num

for i = 1 to num

mschart1.column = i

mschart1.columnlabel = id(i)

next

mschart1.charttype = 14 14是二维饼图,拟合曲线我还不知道怎么画

mschart1.showlegend = true

mschart1.chartdata = details

</script>

</body>

</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 用ASP生成Chart (二维饼图)
分享到: 更多 (0)