# Distinct Methods to Label Axes

## Content



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 [AnnoMethod](/componentone/api/win/online-chart3d/dotnet-framework-api/C1.Win.C1Chart3D.4.8/C1.Win.C1Chart3D.Chart3DAxis.AnnoMethod.html) property. The **C1Chart3D.AnnotationMethodEnum** specifies valid values for this property.

If the AnnoMethod property is set to AnnotationMethodEnum.**Values**, **C1Chart3D** 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 AnnoMethod property is set to AnnotationMethodEnum.**DataLabels**, **C1Chart3D** 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](/componentone/api/win/online-chart3d/dotnet-framework-api/C1.Win.C1Chart3D.4.8/C1.Win.C1Chart3D.Chart3DGroups.RowLabels.html) property of the [Chart3DGroups](/componentone/api/win/online-chart3d/dotnet-framework-api/C1.Win.C1Chart3D.4.8/C1.Win.C1Chart3D.Chart3DGroups.html) object for the chart. For example, the following code specifies three data labels for each of the three rows of a chart:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
With C1Chart3D1
  'assume three rows in chart
  .ChartArea.Axes("X").AnnoMethod = AnnotationMethodEnum.DataLabels
  With .ChartGroups.RowLabels
    .Add(0, "Row 1")
    .Add(1, "Row 2")
    .Add(2, "Row 3")
  End With
End With
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
C1.Win.C1Chart3D.ChartGroups cgs = C1Chart3D1.ChartGroups;
//assume three rows in chart
C1Chart3D1.ChartArea.Axes["X"].AnnoMethod = AnnotationMethodEnum.DataLabels;
cgs.Add(0, "Row 1");
cgs.Add(1, "Row 2");
cgs.Add(2, "Row 3");
```

DOC-DETAILS-TAG-CLOSE

Similarly, labels for the Y-axis are supplied by setting the [ColumnLabels](/componentone/api/win/online-chart3d/dotnet-framework-api/C1.Win.C1Chart3D.4.8/C1.Win.C1Chart3D.Chart3DGroups.ColumnLabels.html) property of the Chart3DGroups object.

If the AnnoMethod property is set to AnnotationMethodEnum.**ValueLabels**, **C1Chart3D** places labels at explicit locations along an axis. The [ValueLabels](/componentone/api/win/online-chart3d/dotnet-framework-api/C1.Win.C1Chart3D.4.8/C1.Win.C1Chart3D.Chart3DAxis.ValueLabels.html) 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:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
With C1Chart3D1.ChartArea.Axes("X")
  .AnnoMethod = AnnotationMethodEnum.ValueLabels
  With .ValueLabels
    .Add(10#, "Label 1")
    .Add(20#, "Label 2")
    .Add(30#, "Label 3")
  End With
End With
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
C1.Win.C1Chart3D.Chart3DAxis axis = C1Chart3D1.ChartArea.Axes["X"];
C1.Win.C1Chart3D.Chart3DAxisLabelsCollection valueLabels = axis.ValueLabels;
axis.AnnoMethod = AnnotationMethodEnum.ValueLabels;
valueLabels.Add(10#, "Label 1");
valueLabels.Add(20#, "Label 2");
valueLabels.Add(30#, "Label 3");
```

DOC-DETAILS-TAG-CLOSE

## See Also

[Design-Time Tools for Creating 3D Charts](/componentone/docs/win/online-chart3d/designtimetoolsforcr)