Can't use literal data with Chart.SetData?

J

Jim Hubbard

I and trying to learn the OCW10 Chart control, but I have come upon a
problem that stumps me.

Here is part of my code....
------------------------------------------------
CSpace.Charts.Add (0)
CSpace.Charts(0).SetData chDimSeriesNames, chDataLiteral, arrRowHeaders
CSpace.Charts(0).SetData chDimCategories, chDataLiteral, ColHeaders

For Counter = 0 To UBound(ColHeaders)
CSpace.Charts(0).SetData chDimValues, chDataLiteral,
arrDatasets(Counter)
Next Counter
------------------------------

But on the line within my For..Next loop I keep getting an error that
reads...

"Run-time error '-214702-4809 (80070057)';

In Chart.SetData, literal data may only be to specify
chDimSeriesNames or chDimCategories."

What does this mean? Can I not use literal data to specify the values?

I've seen lots of code posted that shows this as being the proper way to
fill a chart control.

Did I miss something?

Jim
 
T

Thao Moua [ms]

The error message is correct. If you are trying to
create a chart using literal data then you must set the
data via SetData() at the series level. The only time
you would call SetData() on the chart or chartspace level
is when the chartspace object is bound to an external
datasource ie SQL or other OWC controls.

-tm
 
J

Jim Hubbard

Got it. Thanks for the help!

Thao Moua said:
The error message is correct. If you are trying to
create a chart using literal data then you must set the
data via SetData() at the series level. The only time
you would call SetData() on the chart or chartspace level
is when the chartspace object is bound to an external
datasource ie SQL or other OWC controls.

-tm
 

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