ComponentOne Chart 8.0 for ActiveX
Adding Points and Series

 

Adding Points and Series

To add points to an existing data series, do the following:

·      Add the number of new points to the NumPoints property for that series. (NumPoints must always equal the number of points in the series.)

·      Set the X and Y properties for the new points.

For example, the following code adds a fifth and sixth point to the first data series:

With Chart2D1.ChartGroups(1).Data
       .IsBatched = True
       .NumPoints(1) = 6
       .X(1, 5) = 2.4
       .Y(1, 5) = 3.77
       .X(1, 6) = 2.85
       .Y(1, 6) = 4.11
       .IsBatched = False
End With

If the data is in array format, the new points are added to all of the series.

To add a new data series, do the following:

·      Add one to the value of the NumSeries property.

·      Set the NumPoints property for the new series to the number of points to be added.

·      Set the X and Y properties for the new points.

The following code adds a second data series containing two points:

With Chart2D1.ChartGroups(1).Data
       .IsBatched = True
       .NumSeries = 2
       .NumPoints(2) = 2
       .X(2, 1) = 1.0
       .Y(2, 1) = 3.14159
       .X(2, 2) = 2.0
       .Y(2, 2) = 6.02
       .IsBatched = False
End With

When a new series is created, a new ChartStyle object is automatically created for it. This chart style controls how the new data points are to be displayed. By changing the properties of this ChartStyle object, you can control the appearance of the new data.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback