Generating chart with ASP (two-dimensional pie chart)

Source: Internet
Author: User
Tags chr
This is the use of 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 as 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 is a two-dimensional pie chart, fitting curve I don't know how to draw yet.
Mschart1.showlegend = True
Mschart1.chartdata = Details
</SCRIPT>
</BODY>
</HTML>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.