XP Chart with XML data source - Adding Series/Binding Help

J

John Oman

Following the example in msdn kb Q286212, I create an XML Document in an asp
script that is called by an htm page with the Chart on it. All works well
with a single series chart as follows:

Dim c
Set c = CSpace.Constants
'Bind the chart to the recordset. Cspace.ConnectionString =
"Provider=MSPersist" Cspace.CommandText = "aget1.asp"
Cspace.SetData c.chDimCategories, c.chDataBound, "ST"
Cspace.SetData c.chDimValues, c.chDataBound, "B0B"

Objective is to get a single chart (line type) with several series plotted
on the same axis:

Dim c
Set c = CSpace.Constants
CSpace.ConnectionString = "Provider=MSPersist"
CSpace.CommandText = "aget1.asp"
CSpace.HasMultipleCharts = False
Dim oChart
Dim oSeries1, oSeries2
Set oChart = Cspace.Charts.Add
'Add a series
Set oSeries1 = oChart.SeriesCollection.Add
oSeries1.Caption = "Booth0"
oSeries1.SetData c.chDimCategories, c.chDataBound, "ST"
oSeries1.SetData c.chDimValues, c.chDataBound, "B0B"
oSeries1.Type = c.chChartTypeLine

'Add a second series
Set oSeries2 = oChart.SeriesCollection.Add
oSeries2.Caption = "Booth1"
oSeries2.SetData c.chDimCategories, c.chDataBound, "ST"
oSeries2.SetData c.chDimValues, c.chDataBound, "B1B"
oSeries2.Type = c.chChartTypeLine

The above script fails at the first .SetData with
"Error: Invalid procedure call or argument"

Can you tell me how to fix it???
Thank you,
John Dummy Oman
 
T

Thao Moua [ms]

Your approach is all wrong. Your code should be changed
to
'-------------------------------------
Dim c
Set c = CSpace.Constants

CSpace.ConnectionString = "Provider=MSPersist"
CSpace.CommandText = "aget1.asp"

CSpace.HasMultipleCharts = False
CSpace.plotallaggregates = C.chPlotAggregatesSeries

CSpace.SetData c.chDimCategories, c.chDataBound, "ST"
CSpace.SetData c.chDimValues, c.chdatabound, array
("BOB","B1B")

CS.Charts(0).Type = c.chChartTypeLine
'-------------------------------------

The reason why your code was failing was the
Series.SetData() is reserved for literal data. All
bounded data must be set at the CSpace level.

-tm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top