OWC 9 ---> OWC11 ChartSpace conversion

D

Dimitry

Hi Guys,
I've been using DataSource Control (DSC) as a data source for my
ChartSpace (csChart) object in OWC9. Now I have to convert following
code to OWC11.
After I changed classid for both objects I get error since ChartSpace
doesn't have ChartDataSources collection anymore.

Is there any other way to bind ChartSpace to DSC in OWC11.
Thank you for help,
Dimitry

Set c = csChart.Constants
For i=0 to iChartMax

Set rsd = DSC.RecordsetDefs.AddNew(
GenerateSQL(i,iSet,sSelectedPeriod), c.dscCommandText)
Set ChartDS = csChart.ChartDataSources.Add
ChartDS.DataSource = DSC
ChartDS.DataMember = rsd.Name
Next
csChart.ChartWrapCount=iWarpCount

'Draw Charts
For iChartNum = 0 To iChartMax
Set oChart=csChart.Charts.Add
With oChart
.SetData c.chDimSeriesNames, iChartNum, "SERIES"
.SetData c.chDimCategories, iChartNum, "PERIOD"
.SetData c.chDimValues, iChartNum, "VALUE"
.HasLegend = True
.Legend.Position =LegendPosition

.HasTitle = True
.Title.Caption = aTitles(iSet)(iChartNum)(0)
.Type = aTitles(iSet)(iChartNum)(6)
.Title.Position =TitlePosition
.Axes(0).Font.Size=7
.Axes(1).Font.Size=6
.PlotArea.Interior.Color =cColor
End With
Next
 
T

Thao Moua [ms]

In OWC9, the Chartspace control can bind to multiple datasources. In OWC10/11, we reduced that number to only 1. So if you have multiple datasources then you'll need multple Chartspace controls, too.

In OWC10/11, all the properties/methods to bind to an external data source reside at the Chartspace level (ie ConnectionString, CommandText, DataMember, and Setdata.

Your new code will be like thi

csChart.DataSource = DS
csChart.DataMember = rsd.Name
csChart.SetData c.chDimSeriesNames, c.ChDataBound, "SERIES
csChart.SetData c.chDimCategories, c.ChDataBound, "PERIOD
csChart.SetData c.chDimValues, c.ChDataBound, "VALUE


Thao Mou
OWC Webchart Suppor

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