用ASP產生二維餅圖

來源:互聯網
上載者:User
<%@ 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>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.