一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

ASP Chart 使用范例

时间:2008-01-12 编辑:简简单单 来源:一聚教程网

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.
Chart.
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 ""

热门栏目