【www.gdgbn.com--面向对象编程】

Simple Chart Example
使用很简单哦,这样就可以了:
用Server.CreateObject建立对象
设置图表属性
调用SaveChart方法保存到硬盘或者用Response.BinaryWrite Chart.Image直接发送
下面这段代码是示范如何建立一个柱图的:
ctBar = 1
cNone = 0
cGradient =6
rem **********************************************************************
rem * Instantiate the Chart component
rem **********************************************************************
Set Chart = Server.CreateObject ("ASPChart.Chart")
rem **********************************************************************
rem * Add a Bar series with 3 points
rem **********************************************************************
Chart.AddSeries (ctBar)
Chart.AddValue 200, "Regular", vbBlue
Chart.AddValue 233, "Enhanced ", vbRed
Chart.AddValue 260, "Free", vbGreen
Chart.BarStyle = cGradient
rem **********************************************************************
rem * Set the PanelColor, remove the OuterBevel
rem **********************************************************************
Chart.PanelColor = vbWhite
Chart.BevelOuter = cNone
Chart.ChartBGColor = vbWhite
rem **********************************************************************
rem * Set the Width and Height of the image
rem **********************************************************************
Chart.Height = 300
Chart.Width = 500
rem **********************************************************************
rem * Set the filename, save the image and write the image tag
rem **********************************************************************
Chart.FileName = "d:inetpubwwwrootimagessmpchrt1.jpg"
"也不知道用Server.MapPath,不知道是笨呢还是图效率高。
Chart.SaveChart
Response.Write ""

本文来源:http://www.gdgbn.com/jsp/3189/