E
Edward
Hello, everyone here.
I got several OWC chart examples, but all were programmed using VB.Net.
When I try to transform it into C#, I failed .
System notified me, it cannot find ChartSpace and any other class of OWC.
below is VB version that works fine.
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Microsoft.Office.Interop
....
'Create a new chartspace:
ChartSpace1 = new Owc.ChartSpace()
'Create a new chart within ChartSpace1:
Chart1 = Chartspace1.Charts.Add(0)
'Add a new dataseries within Chart1:
Chart1_Series1 = Chart1.SeriesCollection.Add(0)
'Define Chart1_Series1 as "scatter" (XY) diagram, with lines and
markers:
Chart1_Series1.Type =
Chartspace1.Constants.chChartTypeScatterLineMarkers
'Name the dataseries (name appears in Legend):
Chart1_Series1.SetData (Owc.ChartDimensionsEnum.chDimSeriesNames,
Owc.ChartSpecialDataSourcesEnum.chDataLiteral, "Chart1_Series1")
'Populate the X and Y values from array:
Chart1_Series1.SetData (Owc.ChartDimensionsEnum.chDimXValues,
Owc.ChartSpecialDataSourcesEnum.chDataLiteral, aX)
Chart1_Series1.SetData (Owc.ChartDimensionsEnum.chDimYValues,
Owc.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
If I want to use C#, all the Owc.* class above cannot be found by System.
All the namespace in VB version have been marked "using" in my C# version.
Hope there is someone using C# with OWC.
Thanks. And can anybody tell me why the difference occurs?
I got several OWC chart examples, but all were programmed using VB.Net.
When I try to transform it into C#, I failed .
System notified me, it cannot find ChartSpace and any other class of OWC.
below is VB version that works fine.
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Microsoft.Office.Interop
....
'Create a new chartspace:
ChartSpace1 = new Owc.ChartSpace()
'Create a new chart within ChartSpace1:
Chart1 = Chartspace1.Charts.Add(0)
'Add a new dataseries within Chart1:
Chart1_Series1 = Chart1.SeriesCollection.Add(0)
'Define Chart1_Series1 as "scatter" (XY) diagram, with lines and
markers:
Chart1_Series1.Type =
Chartspace1.Constants.chChartTypeScatterLineMarkers
'Name the dataseries (name appears in Legend):
Chart1_Series1.SetData (Owc.ChartDimensionsEnum.chDimSeriesNames,
Owc.ChartSpecialDataSourcesEnum.chDataLiteral, "Chart1_Series1")
'Populate the X and Y values from array:
Chart1_Series1.SetData (Owc.ChartDimensionsEnum.chDimXValues,
Owc.ChartSpecialDataSourcesEnum.chDataLiteral, aX)
Chart1_Series1.SetData (Owc.ChartDimensionsEnum.chDimYValues,
Owc.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
If I want to use C#, all the Owc.* class above cannot be found by System.
All the namespace in VB version have been marked "using" in my C# version.
Hope there is someone using C# with OWC.
Thanks. And can anybody tell me why the difference occurs?