读书人

OWC的百分比有关问题

发布时间: 2012-02-17 17:50:41 作者: rapoo

OWC的百分比问题
小弟第一次接触OWC,请教大家:如何显示一个百分比数组的折线图,如果用分数有图,如果用百分比就没有图.代码如下:
<%
dim x,y1,y2,y3
x=split( "a,b,c ", ", ")
y1=split( "10%,20%,30% ", ", ")
y2=split( "0.1,0.2,0.3 ", ", ")


Dim strPicFile
strPicFile=server.MapPath( ". ")& "\tmpchart.gif "


Set ChartTmp = CreateObject( "OWC11.ChartSpace ")
Set cc = ChartTmp.Constants

Set cht = ChartTmp.Charts.Add(0)
cht.Type=cc.chChartTypeColumnClustered


cht.HasLegend = True
cht.Legend.Font.Size = 9
cht.Legend.Position = cc.chLegendPositionBottom

Set Series0 = cht.SeriesCollection.Add(0)
with Series0
.Type=cc.chChartTypeLineMarkers
.SetData cc.chDimCategories, cc.chDataLiteral, x
.SetData cc.chDimValues, cc.chDataLiteral, y1 '如果改成y2就有结果

end with
Set dl = Series0.DataLabelsCollection.Add
dl.hasvalue=true

cht.Axes(cc.chAxisPositionLeft).NumberFormat = "0% "


ChartTmp.ExportPicture strPicFile, "GIF ", 360, 200

Set ChartTmp = Nothing

%>

另外,我如果做一个有折线和柱状的组合图,折线是百分比,柱状是10,20,30之类的数据,要求,柱状图的顶点是折线图上的折点,有两个y轴,左边的表示柱状的,右边的表示折线的百分比.

[解决办法]
在ASP.NET中使用Office Web Components (OWC)创建统计图
作者:孟宪会
http://dotnet.aspx.cc/article/adb6d011-a4ad-43a0-a8bf-3ced872a7a95/read.aspx


读书人网 >ASP

热点推荐