C
Cam Fraser
Hi all:
I am trying to add error bars to some OWC10 Charts. I am using ASP (not
..NET). So far, I've been unable to add anything other than percentage
or fixed value error bars. When I've tried using the
chErrorBarTypeCustom, the result I get is an error bar on only the
first data point in the series. Alvin J. Bruney's otherwise excellent
tome on the office web components offers nothing beyond a bare mention
of the errorbarscollection. I've attached the relevant code snippet
below. Any help you can offer would be greatly appreciated.
Cam Fraser
[snippet]
sql = "SELECT rate, year, (higher95-rate) as YHigh, (rate-lower95) as
YLow FROM " & TableName
if len(where_clause)>0 then
sql = sql & " WHERE " & where_clause & " ORDER BY year"
end if
set rs = cn.execute(sql)
i = 0
do while not rs.EOF
aXPt(i) = rs("year")
aYPt(i) = rs("rate")
aYhigh(i) = rs("YHigh")
aYlow(i) = rs("YLow")
'response.write "#"&i&" ("&rs("YHigh")&","&rs("YLow")&")"&vbCrLf
i = i + 1
rs.MoveNext
loop
set m_cspace = server.CreateObject("OWC10.ChartSpace")
set cht = m_cspace.Charts.Add()
set c = m_cspace.Constants
cht.Type = c.chChartTypeLineMarkers
cht.HasLegend = False
M_cspace.DisplayFieldButtons = False
set m_cspace.DataSource = m_rs
cht.SetData c.chDimCategories, c.chDataLiteral, aXPt
cht.SetData c.chDimValues, 0, aYPt
'add error bars
set ErrorBar1 = cht.SeriesCollection(1).ErrorBarsCollection.Add()
ErrorBar1.Type = c.chErrorBarTypeCustom
ErrorBar1.Line.Color = "Green"
ErrorBar1.SetData c.chErrorBarPlusValues, c.chDataLiteral, "YHigh"
ErrorBar1.SetData c.chErrorBarMinusValues, c.chDataLiteral, "YLow"
[/snippet]
I am trying to add error bars to some OWC10 Charts. I am using ASP (not
..NET). So far, I've been unable to add anything other than percentage
or fixed value error bars. When I've tried using the
chErrorBarTypeCustom, the result I get is an error bar on only the
first data point in the series. Alvin J. Bruney's otherwise excellent
tome on the office web components offers nothing beyond a bare mention
of the errorbarscollection. I've attached the relevant code snippet
below. Any help you can offer would be greatly appreciated.
Cam Fraser
[snippet]
sql = "SELECT rate, year, (higher95-rate) as YHigh, (rate-lower95) as
YLow FROM " & TableName
if len(where_clause)>0 then
sql = sql & " WHERE " & where_clause & " ORDER BY year"
end if
set rs = cn.execute(sql)
i = 0
do while not rs.EOF
aXPt(i) = rs("year")
aYPt(i) = rs("rate")
aYhigh(i) = rs("YHigh")
aYlow(i) = rs("YLow")
'response.write "#"&i&" ("&rs("YHigh")&","&rs("YLow")&")"&vbCrLf
i = i + 1
rs.MoveNext
loop
set m_cspace = server.CreateObject("OWC10.ChartSpace")
set cht = m_cspace.Charts.Add()
set c = m_cspace.Constants
cht.Type = c.chChartTypeLineMarkers
cht.HasLegend = False
M_cspace.DisplayFieldButtons = False
set m_cspace.DataSource = m_rs
cht.SetData c.chDimCategories, c.chDataLiteral, aXPt
cht.SetData c.chDimValues, 0, aYPt
'add error bars
set ErrorBar1 = cht.SeriesCollection(1).ErrorBarsCollection.Add()
ErrorBar1.Type = c.chErrorBarTypeCustom
ErrorBar1.Line.Color = "Green"
ErrorBar1.SetData c.chErrorBarPlusValues, c.chDataLiteral, "YHigh"
ErrorBar1.SetData c.chErrorBarMinusValues, c.chDataLiteral, "YLow"
[/snippet]