OWC10 Chart binding with OWC10 Spreadsheet not working

S

Sridhar

Hi,
Iam trying to bind the OWC10 chart component with OWC10 spreadsheet
component as datasource in VB.net. Iam not getting any errors. But in the
output iam not getting any graph. It shows an empty graph.

This is my programming environment.
OS : Windows 2000 SP3
MS-Office : Office XP - 2002 - SP1
Tool : Visual Studio 2003
Framework : .NET Framework 1.1
Web Component : Microsoft Web Components 10.0

This is the code i used,

Imports AxOWC10


Dim oChart
Dim oSeries1, oSeries2
Dim oAxis1, oAxis2

With AxChartSpace1
.Clear()
.Refresh()
.DataSource = AxSpreadsheet1.GetOcx
End With

'Create a new chart in the ChartSpace.
oChart = AxChartSpace1.Charts.Add

'Add a series of type Column.
oSeries1 = oChart.SeriesCollection.Add
oSeries1.Caption = "LSFO SOB"
oSeries1.SetData(OWC10.ChartDimensionsEnum.chDimCategories,
OWC10.ChartSpecialDataSourcesEnum.chDataLiteral,
AxSpreadsheet1.ActiveSheet.Range(AxSpreadsheet1.ActiveSheet.Cells(2, 1),
AxSpreadsheet1.ActiveSheet.Cells(26, 1)).Address) '"A2:A26"

oSeries1.SetData(OWC10.ChartDimensionsEnum.chDimValues,
OWC10.ChartSpecialDataSourcesEnum.chDataLiteral,
AxSpreadsheet1.ActiveSheet.Range(AxSpreadsheet1.ActiveSheet.Cells(2, 2),
AxSpreadsheet1.ActiveSheet.Cells(26, 2)).Address) ' "B2:B26"
oSeries1.Type = OWC10.ChartChartTypeEnum.chChartTypeColumnStacked

Could any of you please help me, what is the problem ?
I checked all the sites, everywhere the syntax for setdata is the same what
i gave. Even then iam not getting the graph. Please help me to sort out the
issue.
 
F

Fu Ruijin

Hi,

In your setdata function, please change
"OWC10.ChartSpecialDataSourcesEnum.chDataLiteral" to
"OWC10.ChartSpecialDataSourcesEnum.chDataBound" and try again.

BTW, I am using C# to do the same job as yours but I could bind spread data
to chart in C#. Could pls recommend some sites to address this issue? Thanks.
 
A

Alvin Bruney [MVP]

because the spreadsheet implements idatasource, it is considered a bonafide
datasource so you will need to use chbound instead of literal as was pointed
out in the previous post
 

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