Programming Considerations > Programming In C++ > Using Collections in C++ |
Many 2D Chart objects are organized into collections. For example, the chart axes are organized into the Axes collection.
To access a particular element of a collection, specify the index which uniquely identifies this element. For example, the following code changes the maximum value of the X axis to 25.1:
Caxis axisX(m_chart.GetChartArea().GetAxes().GetItem(COleVariant("x")));
axisX.GetMax().SetValue(25.1);
Note that the index 1 refers to the first element of a collection.