ComponentOne Chart 8.0 for ActiveX
Axis Labeling Programming Considerations

 

Axis Labeling Programming Considerations

There are three distinct ways to label axes when using the 3D Chart control:

·      The axis can be automatically labeled based on the range of data.

·      Surface lines or bar row/columns can be individually labeled.

·      Labels can be placed at explicit locations along an axis.

The axis labeling method in use for a particular axis is specified by the AnnotationMethod property. Valid values for this property are specified by the annotation method constants.

If the AnnotationMethod property is set to oc3dAnnotateValues, ComponentOne Chart will automatically annotate the axis based on the range of the data. This is most suitable for the Z-axis, and for surface charts.

If the AnnotationMethod property is set to oc3dAnnotateDataLabels, ComponentOne Chart uses a list of strings to annotate each grid line or bar. This labeling method can only be used on the X- and Y-axes. For the X-axis, the labels are supplied by setting the RowLabels property of the ChartGroup object for this chart. For example, the following code specifies three data labels for each of the three rows of a chart:

With Chart3D1

       ' assume three rows in chart

       .ChartArea.Axis("X").AnnotationMethod = oc3dAnnotateDataLabels

       With .ChartGroups(1).RowLabels

              .Add "Row 1"

              .Add "Row 2"

              .Add "Row 3"

       End With

End With

Similarly, labels for the Y-axis are supplied by the setting the ColumnLabels property of the ChartGroup object.

If the AnnotationMethod property is set to oc3dAnnotateValueLabels, ComponentOne Chart places labels at explicit locations along an axis. The ValueLabels property, which is a ValueLabels collection, supplies this list of strings and their locations. For example, the following code sets chart labels at the locations 10, 20 and 30:

With Chart3D1.ChartArea.Axis("X")

       .AnnotationMethod = oc3dAnnotateValueLabels

       With .ValueLabels

              .Add 10#, "Label 1"

              .Add 20#, "Label 2"

              .Add 30#, "Label 3"

       End With

End With

 

 


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

Product Support Forum  |  Documentation Feedback