HELP! Cannot Get Chart To Show Data

J

Joe Helmick

I'm sure I'm missing something basic, but as this is my first time working with
web chart, I can't figure out what's wrong. Could someone please tell me why my
chart is not being populated with any data at all? It has X and Y ranges that
don't make sense and no lines at all on it. Here's the code:

(USING OWC 9 library reference)


For r = 0 To 16
x(r) = r
y1(r) = 4 + (r / 4)
Next

Dim oCS As New OWC.ChartSpace
oCS.Charts.Add()
oCS.Charts(0).Type =
OWC.ChartChartTypeEnum.chChartTypeScatterSmoothLine

oCS.Charts(0).SeriesCollection.Add()

oCS.Charts(0).SeriesCollection(0).SetData(OWC.ChartDimensionsEnum.chDimXValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, x)

oCS.Charts(0).SeriesCollection.Add()

oCS.Charts(0).SeriesCollection(0).SetData(OWC.ChartDimensionsEnum.chDimYValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, y1)

Dim sFileName As String = "c:\temp\chart.gif"
oCS.ExportPicture(sFileName, "gif", 600, 450)
Response.Write("<img src='" & sFileName & "'>")

It's creating the chart GIF file, but it's just empty.

Can someone set me straight here?

Joe
 
T

Thao Moua [ms]

I ran your code on client side and it worked as expected. Try charting a regular column or line chart and see if that works. You might want to remove the second SeriesCollection.Add() code as it is unnecessary.

What OS and OWC9 versions are you running

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