Also, AxisMarkerAnnotation can be aligned relative to the X1 or Y1 coordinate by setting Anchor Points.
For more information about the Anchor Points - refer to the corresponding section Annotations APIs article.
NOTE: The xAxisId and yAxisId must be supplied if you have axis with non-default Axis Ids, e.g. in multi-axis scenario.
// Assume a surface has been created and configured somewhere
id<ISCIChartSurface> surface;
// Prepare UIImageView for the AxisMarkerCustomAnnotation
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
imageView.image = [UIImage imageNamed:@“image.arrow.right”];
imageView.contentMode = UIViewContentModeScaleAspectFit;
// Create an AxisMarkerAnnotation
SCIAxisMarkerCustomAnnotation *rightMarker = [SCIAxisMarkerCustomAnnotation new];
// Supply it with UIImageView
rightMarker.customView = imageView;
// Specify a desired position by setting the Y1 coordinate, since the marker is going to be located on an Y axis
rightMarker.y1 = @(9);
// Allow to interact with the annotation in run-time
rightMarker.isEditable = YES;
// In a multi-axis scenario, specify the XAxisId and YAxisId
rightMarker.xAxisId = BottomAxisId;
rightMarker.yAxisId = RightAxisId;
// Specify a desirable axis to place the annotation
rightMarker.annotationSurface = SCIAnnotationSurface_YAxis;
// Add the annotation to the Annotations collection of the surface
[self.surface.annotations add:rightMarker];
// Assume a surface has been created and configured somewhere
let surface: ISCIChartSurface
// Prepare UIImageView for the AxisMarkerCustomAnnotation
let imageView = UIImageView.init(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize.init(width: 20, height: 20)))
imageView.image = UIImage(named: “image.arrow.right”)
imageView.contentMode = .scaleAspectFit
// Create an AxisMarkerAnnotation
let rightMarker = SCIAxisMarkerCustomAnnotation()
// Supply it with UIImageView
rightMarker.customView = imageView
// Specify a desired position by setting the Y1 coordinate, since the marker is going to be located on an Y axis
rightMarker.set(y1: 9)
// Allow to interact with the annotation in run-time
rightMarker.isEditable = true
// In a multi-axis scenario, specify the XAxisId and YAxisId
rightMarker.xAxisId = BottomAxisId
rightMarker.yAxisId = RightAxisId
// Specify a desirable axis to place the annotation
rightMarker.annotationSurface = .yAxis
// Add the annotation to the Annotations collection of the surface
self.surface.annotations.add(rightMarker)
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.