A SCILineArrowAnnotation is placed on a chart at the position determined by its [X1, Y1] and [X2, Y2] coordinates, which specifies the start and end of the arrow.
Those can be accessed via the following properties:
// Assume a surface has been created and configured somewhere
id<ISCIChartSurface> surface;
// Create a LineArrow Annotation
SCILineArrowAnnotation *lineArrowAnnotation = [SCILineArrowAnnotation new];
// Allow to interact with the annotation in run-time
lineArrowAnnotation.isEditable = YES;
// in a multi-axis scenario, specify the XAxisId and YAxisId
lineArrowAnnotation.xAxisId = TopAxisId;
lineArrowAnnotation.yAxisId = LeftAxisId;
// Specify size for the arrow’s head
lineArrowAnnotation.headLength = 4;
lineArrowAnnotation.headWidth = 8;
// Specify a desired position by setting coordinates
lineArrowAnnotation.coordinateMode = SCIAnnotationCoordinateMode_RelativeY;
lineArrowAnnotation.x1 = @(40);
lineArrowAnnotation.y1 = @(0.8);
lineArrowAnnotation.x2 = @(100);
lineArrowAnnotation.y2 = @(0.2);
// Specify the stroke color for the annotation
lineArrowAnnotation.stroke = [[SCISolidPenStyle alloc] initWithColor:UIColor.yellowColor thickness:2];
// Add the annotation to the Annotations collection of the surface
[self.surface.annotations add:lineArrowAnnotation];
// Assume a surface has been created and configured somewhere
let surface: ISCIChartSurface
// Create a LineArrow Annotation
let lineArrowAnnotation = SCILineArrowAnnotation()
// Allow to interact with the annotation in run-time
lineArrowAnnotation.isEditable = true
// In a multi-axis scenario, specify the XAxisId and YAxisId
lineArrowAnnotation.xAxisId = TopAxisId
lineArrowAnnotation.yAxisId = LeftAxisId
// Specify size for the arrow’s head
lineArrowAnnotation.headLength = 4
lineArrowAnnotation.headWidth = 8
// Specify a desired position by setting coordinates
lineArrowAnnotation.coordinateMode = .relativeY
lineArrowAnnotation.set(x1: 40)
lineArrowAnnotation.set(y1: 0.8)
lineArrowAnnotation.set(x2: 100)
lineArrowAnnotation.set(y2: 0.2)
// Specify the stroke color for the annotation
lineArrowAnnotation.stroke = SCISolidPenStyle(color: .yellowColor, thickness: 2)
// Add the annotation to the Annotations collection of the surface
self.surface.annotations.add(lineArrowAnnotation)
// Assume a surface has been created and configured somewhere
IISCIChartSurface surface;
// Create a LineArrow Annotation
var lineArrowAnnotation = new SCILineArrowAnnotation
{
// Allow to interact with the annotation in run-time
IsEditable = true,
// In a multi-axis scenario, specify the XAxisId and YAxisId
XAxisId = TopAxisId,
YAxisId = LeftAxisId,
// Specify size for the arrow’s head
HeadLength = 4,
HeadWidth = 8,
// Specify a desired position by setting coordinates
CoordinateMode = SCIAnnotationCoordinateMode.RelativeY,
X1Value = 20,
Y1Value = 0.2,
X2Value = 60,
Y2Value = 0.8,
// Specify the stroke color for the annotation
Stroke = new SCISolidPenStyle(UIColor.Yellow, 2),
};
// Add the annotation to the Annotations collection of the surface
Surface.Annotations.Add(lineArrowAnnotation);
NOTE: To learn more about other Annotation Types, available out of the box in SciChart, please find the comprehensive list in the Annotation APIs article.