ComponentOne Chart for .NET (2.0) Search HelpCentral 

Attaching the Chart Label by Data Point

To attach a ChartLabel to a data point, set the AttachMethod property to AttachMethodEnum.DataIndex, and then under the AttachMethodData object set the GroupIndex, SeriesIndex, and PointIndex properties. These properties specify the ChartGroup, Series, and Point indices. PointIndex refers to the element of the data array. SeriesIndex refers to the element of the series array. Each series has arrays of data.

The following code example attaches a ChartLabel to a data point:

·      Visual Basic

With C1Chart1.ChartLabels.LabelsCollection(0)

    .AttachMethod = AttachMethodEnum.DataIndex

    .AttachMethodData.GroupIndex = 0

    .AttachMethodData.SeriesIndex = 1

    .AttachMethodData.PointIndex = 2

End With

·      C#

C1.Win.C1Chart.Label lab = C1Chart1.ChartLabels.LabelsCollection[0];

lab.AttachMethod = AttachMethodEnum.DataIndex;

lab.AttachMethodData.GroupIndex = 0;

lab.AttachMethodData.SeriesIndex = 1;

lab.AttachMethodData.PointIndex = 2;

·      Delphi

var

  lab: C1.Win.C1Chart.Label

begin

  lab := C1Chart1.ChartLabels.LabelsCollection[0];

  lab.AttachMethod := AttachMethodEnum.DataIndex;

  lab.AttachMethodData.GroupIndex := 0;

  lab.AttachMethodData.SeriesIndex := 1;

  lab.AttachMethodData.PointIndex := 2;

end;


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.