B
Brian Cecil
I'm new to OWC charts.
I'm trying to display a simple graph based on a query from a database.
It seems I am getting one more chart than I should be. As soon as I
assign the recordset to the chart datasource, I get an extra chart in
my charts collection. Any ideas?
strChartAbsPath = "c:\temp"
strChartRelPath = "temp"
Set objChartSpace = CreateObject("OWC11.ChartSpace")
Set objchart = objChartSpace.Charts.Add()
Set c = objChartSpace.Constants
objchart.Type = c.chChartTypeLine
objchart.Type = c.chChartTypeColumnClustered
objchart.HasLegend = True
objChartSpace.DisplayFieldButtons = False
Set objConn = CreateObject("ADODB.Connection")
'Other recordset stuff here...
objRS.Open "select * from testscore order by test"
Set objChartSpace.DataSource = objRS
'After the above call, I have both a objChartSpace.Charts(0) and a
'objChartSpace.Charts(1). Shouldn't I have just the
objChartSpace.Charts(0)???
objchart.SetData c.chDimSeriesNames, 0, "student"
objchart.SetData c.chDimCategories, 0, "test"
objchart.SetData c.chDimValues, 0, "score"
objchart.HasTitle = True
objchart.Title.Caption = "My Title"
For Each Axis In objchart.Axes
Axis.HasTitle = True
If Axis.Type = c.chCategoryAxis Then
Axis.Title.Caption = "Test"
Else
Axis.Title.Caption = "Score"
End If
Next
I'm trying to display a simple graph based on a query from a database.
It seems I am getting one more chart than I should be. As soon as I
assign the recordset to the chart datasource, I get an extra chart in
my charts collection. Any ideas?
strChartAbsPath = "c:\temp"
strChartRelPath = "temp"
Set objChartSpace = CreateObject("OWC11.ChartSpace")
Set objchart = objChartSpace.Charts.Add()
Set c = objChartSpace.Constants
objchart.Type = c.chChartTypeLine
objchart.Type = c.chChartTypeColumnClustered
objchart.HasLegend = True
objChartSpace.DisplayFieldButtons = False
Set objConn = CreateObject("ADODB.Connection")
'Other recordset stuff here...
objRS.Open "select * from testscore order by test"
Set objChartSpace.DataSource = objRS
'After the above call, I have both a objChartSpace.Charts(0) and a
'objChartSpace.Charts(1). Shouldn't I have just the
objChartSpace.Charts(0)???
objchart.SetData c.chDimSeriesNames, 0, "student"
objchart.SetData c.chDimCategories, 0, "test"
objchart.SetData c.chDimValues, 0, "score"
objchart.HasTitle = True
objchart.Title.Caption = "My Title"
For Each Axis In objchart.Axes
Axis.HasTitle = True
If Axis.Type = c.chCategoryAxis Then
Axis.Title.Caption = "Test"
Else
Axis.Title.Caption = "Score"
End If
Next