Strange Results in Chartspace Chart

P

Paul

While attempting to populate information directly to a ChartSpace object
within an HTA the chart does not correctly represent the data correctly.
Even when plotting a constant value of 250 it registers values like 1250 and
1500 with dips to 250, 1000 and 0 (just as an example, I have a couple of
charts that register values in the tens of thousands using the same code to
write 250 for each point). Below are some snippets of the code pertaining to
the specific areas for populating the data.

The reason I am not binding data to a spreadsheet or recordset is because
the information will come from a variety of sources including databases,
spreadsheets and other sources. I would build an XML string and bind to
that, but the only I believe that this can be done is to use the pivot chart
object in between and I would like to minimize the overhead as much as
possible.


....
ChartObject.Charts(0).SeriesCollection.Add
ChartObject.Charts(0).SeriesCollection(0).SetData
chConstants.chDimCategories, chConstants.chDataLiteral, Categories
ChartObject.Charts(0).SeriesCollection(0).Caption = "Stores Scheduled"

ChartObject.Charts(0).SeriesCollection.Add
ChartObject.Charts(0).SeriesCollection(1).Caption = "Scheduled To Be
Complete"

ChartObject.Charts(0).SeriesCollection.Add
ChartObject.Charts(0).SeriesCollection(2).Caption = "Completed"
....
T = 0
Do Until rs.EOF
L2 = rs.Collect("ScheduleDate") - StartChartDate
'On Error Resume Next
' T = T + rs.Collect("Scheduled")
' Values(L2) = T
Values(L2) = 250
'On Error Goto 0
rs.MoveNext
Loop

rs.Close

ChartObject.Charts(0).SeriesCollection(1).SetData
chConstants.chDimValues, chConstants.chDataLiteral, Values
....
 

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