Changing/Editing Series Captions

J

jtertin

Simply, I am populating a chart like this:

==============================================

'CHART CONTROL CONSTANTS AND CLEARING
Dim c
Set c = ChartSpace1.Constants
ChartSpace1.Clear

'POPULATE RECORD SET
Dim con As Object
Dim ChartRecordset As New ADODB.Recordset
Dim MaxDate As Date
Set con = Application.CurrentProject.Connection
ChartRecordset.Open "SELECT * from [ChartData]", con, adOpenStatic
Set ChartSpace1.DataSource = ChartRecordset

'SET CHART DATA
ChartSpace1.Charts(0).Type = c.chChartTypeLine
ChartSpace1.PlotAllAggregates = c.chPlotAggregatesSeries
ChartSpace1.SetData c.chDimCategories, c.chDataBound, "Time"
ChartSpace1.SetData c.chDimValues, c.chDataBound,
FieldArray([ColumnNamesToBeTrended])

==============================================

This approach causes my series names (captions) to appear as "Sum of
[Field]" in the legend. Somehow, they are now actually displaying
"Sun of [Field] (4)" or "...(3)" like there are duplicates somewhere.

1. Any idea why the "(3)" would be added to the end of the series? I
noticed that if I double click on the chart control that there ARE
series under the "Series Groups" tab, but why are these being used if
I call the ChartSpace1.Clear method before I add my series to the
control? The series do not appear in the Series Collection until the
following line is executed: "ChartSpace1.PlotAllAggregates =
c.chPlotAggregatesSeries" which I appear to need in order to plot
multiple series on the same chart.

2. How can I programatically change the caption for an existing
series? I simply want them to display the same thing as the column
headings (the same strings that are in the FieldArray) without the
"Sum of" in front of them.

Thank you for the help!!!
 

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