OWC Chart draws, but no data

raysot

Newcomer
Joined
Dec 3, 2004
Messages
1
I am using the OWC charting facility, and while I can generate the chart image, I can't get any data to display. I have force-fed the arrays, but to no avail. If someone could please review the code below and make any suggestions, I would be forever grateful. This project has fought me every step of the way.

The project compiles, with no errors, outputs the chart, but alas... no scatter points.

Help! :-)



aX(0) = 0.2
aX(1) = 0.3
aX(2) = 0.4
aX(3) = 0.4

aY(0) = 0.71
aY(1) = 0.75
aY(2) = 0.77
aY(3) = 0.74

'Create a new chartspace:
Dim ChartSpace1 As New OWC.ChartSpace
'Create a new chart within ChartSpace1:
Dim Chart1 = ChartSpace1.Charts.Add(0)
'Add a new dataseries within Chart1:
Dim 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, "Growth")
'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)

'Format the chartspace elements.
With ChartSpace1
.Border.Color = ChartSpace1.Constants.chColorNone
End With

'Format the chart elements.
With Chart1
.SeriesCollection(0).Interior.Color = "Rosybrown"
.PlotArea.Interior.Color = "Wheat"
.HasLegend = True
.Legend.Position = OWC.ChartLegendPositionEnum.chLegendPositionTop
.HasTitle = True
.Title.Caption = list_ReportType.SelectedValue + " Database Growth Report for: " + list_DBList.SelectedValue
.Axes(0).HasTitle = True
.Axes(0).Title.Caption = "Size (In Mb)"
.Axes(1).HasTitle = True
.Axes(1).Title.Caption = "Time..."
End With

'Return the new chart in GIF format.
Response.BinaryWrite(ChartSpace1.GetPicture("gif", 640, 480))
Response.End()
 
Back
Top