asp中如何实现统计图表

来源:百度知道 编辑:UC知道 时间:2024/06/22 02:03:09
比如用柱形图、条形图、饼状图等体现数据库中的数据量分析。

这个要使用OWC组件,是office自带的,用在服务器上只要注册一下OWC11.DLL就可以直接使用了。
我写过一个函数,大概能用,不过是直接生成图片,你可以去网上找OWC关键字看看

CAll OwcToGif(3,"分析雷达图","A8_3",8)'(类型,图表名称,存储文件名,共几组)

Sub OwcToGif(ChartType,ImgTitle,ImgName,MaxImum)
oChart.Border.Color=c.chColorNone'无边框
oChart.Charts.Add
oChart.Charts(0).PlotArea.Interior.Color = "#CCFFFF" '背景颜色
oChart.Charts(0).PlotArea.Floor.Interior.Color = "#999999"'底盘颜色
Select Case ChartType
Case 1 '柱形图
oChart.Charts(0).Type = oChart.Constants.chChartTypeColumnStacked3d
Case 2 '饼形图
oChart.Charts(0).Type = oChart.Constants.chChartTypePie3D
Case 3 '雷达图
oChart.Charts(0).Type =oChart.Constants.chChartTypeRadarLineFilled
Case Else
oChart.Charts(0).Type = oChart.Constants.chChartTypeColumnStacked3d
End Select
oChart.Charts(0).Inclination=0 '上下倾斜度
oChart.Charts(0).AmbientLightIntens