setdata works on chartspace but not series

J

John Grant

I am trying to add series to my chart. The example using VBScript does not
work in jScript.

Me.ChartSpace1.Clear

Set Me.ChartSpace1.DataSource = rs
Me.ChartSpace1.SetData chDimCategories, 0, "CategoryName"

Set c = Me.ChartSpace1.Charts(0)
cType = chChartTypeColumnClustered

Me.ChartSpace1.HasMultipleCharts = False
Me.ChartSpace1.PlotAllAggregates = chPlotAggregatesSeries

Me.ChartSpace1.SetData chDimValues, 0, Array("UnitsInStock",
"UnitsOnOrder", "ReorderLevel")

So I tied setting the series directly but it fails.

Dim s As ChSeries
Set s = c.SeriesCollection.Add()
s.Type = chChartTypeColumnClustered
s.SetData chDimValues, 0, "UnitsInStock"
 
T

Thao Moua [ms]

When a chart is bound to external data, SetData() must be call at the
chartspace level. Calling SetData() at the series level is only allowed when
the chart is bound to literal data.

----------------------------------------------------------------------
Thao Moua
OWC Chartspace Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

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