# Attaching the Chart Label by Pixel Coordinate

## Content



In a coordinate attachment the label can be attached anywhere on the chart. The number of pixels between the top-left corner of the chart to the ChartLabel can be specified.

To attach a ChartLabel to a pixel coordinate, set the [AttachMethod](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Label.AttachMethod.html) property to [AttachMethodEnum](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodEnum.html)**.Coordinate**, and then under the [AttachMethodData](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodData.html) object set the [X](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodData.X.html) and the [Y](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodData.Y.html) properties to the coordinates at which the ChartLabel is to be attached. For example, the following attaches a ChartLabel to the coordinates specified:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
With C1Chart1.ChartLabels.LabelsCollection(0)
    .AttachMethod = AttachMethodEnum.Coordinate
    .AttachMethodData.X = 250
    .AttachMethodData.Y = 250
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.C1Chart.Label lab = c1Chart1.ChartLabels.LabelsCollection[0];
lab.AttachMethod = AttachMethodEnum.Coordinate;
lab.AttachMethodData.X = 250;
lab.AttachMethodData.Y = 250;
```

DOC-DETAILS-TAG-CLOSE

For more information on how to attach the chart label by pixel coordinate at design time see, [Attach By Coordinate](/componentone/docs/win/online-chart2d/chartforwinformstask/creatingandformattin1/attachchartlabels/attachbycoordinate).

## See Also

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