ComponentOne Chart 8.0 for ActiveX
Using Collections with Objects

 

Using Collections with Objects

Many 2D Chart objects are organized into collections. For example, the chart axes are organized into the Axes collection.

All collections are indexed by number, with 1 referring to the first element of the collection, 2 the second, and so on. If the objects in a collection have a Name property, the collection can also be indexed by object name. For example:

Chart2D1.ChartArea.Axes("X").Max = 25.1

This statement accesses the axis named “X” (the X-axis), and sets the maximum value of this axis to 25.1. Note that Visual Basic recognizes the default Item property of the collection, whereas other environments may require an explicit reference to the Item property:

Chart2D1.ChartArea.Axes.Item("X").Max = 25.1

Some 2D Chart collections are static, whereas others are dynamic. Dynamic collections have Add and Remove methods defined. Elements cannot be added to or removed from static collections.

For more details on the behavior of Visual Basic collections, refer to the Visual Basic documentation.

 

 


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

Product Support Forum  |  Documentation Feedback