# Attach By Data Index

## Content



The **Attached By Data Index** command item gets the **DataIndex** member of the AttachMethodEnum and sets the value of the Label.AttachMethod property in the Label. It attaches the label to a specific data point on the plot area of the chart. The [GroupIndex](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodData.GroupIndex.html), [PointIndex](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodData.PointIndex.html), and [SeriesIndex](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.AttachMethodData.SeriesIndex.html) properties can be specified. The following steps show how to attach the label using this method:

1.  Select an existing Chart label and select the **Attached By Data Index** item from its drop-down menu.
2.  Click on the **Properties** button of the **Label** toolbar and observe the following in its **Edit labels** editor:
    
    *   The AttachMethod is now set to **DataIndex** since the **Attached by Data Index** item was chosen.
    *   Expand the AttachMethodData object. Notice that the Point Index and Series Index properties each have a value associated with it. This is because the DataIndex attachment method attaches the labels by the data point. The GroupIndex value of 0 represents the ChartGroup0, the PointIndex value of 1 represents the second data point on the series, and the SeriesIndex value of 2 represents the third series on the chart.
    
    The following image illustrates the two observations:<br />![](https://cdn.mescius.io/document-site-files/images/70bd33a2-280e-4cc3-a1c0-7b827eceb8aa/imagesext/image10_98.png)
3.  If you would like the label to represent a different data point then change the PointIndex and SeriesIndex properties in the **Edit labels** editor. For example, let's say we would like the label on series1, point3. In the **Edit labels** editor we change the SeriesIndex value to 1 and the PointIndex value to 3. The label appears on the series1, point3.

## See Also

[Candle Chart Tasks](/componentone/docs/win/online-chart2d/chartforwinformstask/candlecharttasks)