# Attaching and Positioning Chart Labels

## Content



When defining a ChartLabel, it is necessary to specify how to attach it to the chart and where to position it relative to its attachment point.

The attachment method chosen depends on what the ChartLabel is going to be used for. The attachment method takes an [AttachMethodEnum](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodEnum.html) value with four possible values: Coordinate, DataCoordinate, DataIndex, and DataIndexY.

ChartLabels can be attached to a chart in one of four ways:

*   To a pixel (x,y) coordinate
*   To a data (x,y) coordinate in the ChartArea
*   To a (series, point) in the ChartArea
*   To a (series, point, Y value) in the ChartArea

The following image illustrates the ChartLabel attachment methods:

<br />![](https://cdn.mescius.io/document-site-files/images/70bd33a2-280e-4cc3-a1c0-7b827eceb8aa/imagesext/image9_179.png)

The following list explains each attachment method for the ChartLabels:

*   AttachMethodEnum.**Coordinate** attaches the label anywhere on the chart. The number of pixels can be specified between the top-left corners of the chart to the ChartLabel.
*   AttachMethodEnum.**DataCoordinate** attaches the label anywhere inside the PlotArea. The data coordinates can be specified. This method is not allowed on Pie charts using PointLabels for the X-axis annotation. If any part of the ChartLabel falls outside of the ChartArea, it is clipped.
*   AttachMethodEnum.**DataIndex** attaches the label to a specific data point on the chart. The series and point indices, and the ChartGroup can be specified.
*   AttachMethodEnum.**DataIndexY** attaches the label to a distance above or below a specific data point. The series and point indices, the ChartGroup, and the Y-coordinate can be specified. This is most useful for Bar and Stacking Bar charts.

Use the **AttachMethod** property of the **Label** class to set the attachment method, and the properties of the [AttachMethodData](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodData.html) class to set the attachment point. These properties can be accessed programmatically through the [Label](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Label.html) class or at design time through the **Labels Collection** editor or the **Edit Labels** designer. For more information on setting the ChartLabel methods at design time using Chart's Smart Designer, see Attaching and Positioning Chart Labels.

## See Also

[Attaching the Chart Label by Pixel Coordinate](/componentone/docs/win/online-chart2d/chartinglabels/attachingandposition/attachingthechartlab)

[Attaching the Chart Label by Data Coordinate](/componentone/docs/win/online-chart2d/chartinglabels/attachingandposition/attachingthechartlab1)

[Attaching the Chart Label by Data Point](/componentone/docs/win/online-chart2d/chartinglabels/attachingandposition/attachingthechartlab2)

[Attaching the Chart Label by Data Point and Y Value](/componentone/docs/win/online-chart2d/chartinglabels/attachingandposition/attachingthechartlab3)