ComponentOne Chart for .NET (2.0) Search HelpCentral 

Attaching the Chart Label by Pixel Coordinate

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 property to AttachMethodEnum.Coordinate, and then under the AttachMethodData object set the X and the Y properties to the coordinates at which the ChartLabel is to be attached. For example, the following attaches a ChartLabel to the coordinates specified:

·      Visual Basic

With C1Chart1.ChartLabels.LabelsCollection(0)

    .AttachMethod = AttachMethodEnum.Coordinate

    .AttachMethodData.X = 250

    .AttachMethodData.Y = 250

End With

·      C#

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

lab.AttachMethod = AttachMethodEnum.Coordinate;

lab.AttachMethodData.X = 250;

lab.AttachMethodData.Y = 250;

·      Delphi

var

  lab: C1.Win.C1Chart1.Label;

begin

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

  lab.AttachMethod := AttachMethodEnum.Coordinate;

  lab.AttachMethodData.X := 250;

  lab.AttachMethodData.Y := 250;

end;


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