iOS Charting Documentation - SciChart
Intro to the Annotations API

SciChart features a rich Annotations API, that allows you to place UIKit elements over the chart.

Annotations can provide interactive horizontal/vertical lines (thresholds), text/callouts as well as measurements such as Peak-to-peak. Annotations can be edited by tap & drag, simply added programmatically. SciChat provides a number of built-in annotations, but you can also create your own.

Common Annotation Properties

All annotations in SciChart are derived from the AnnotationBase type. The common properties of the AnnotationBase class are listed below:

AnnotationBase Property

Description

CoordinateMode

Determines how coordinates X1,Y1,X2,Y2 are used when placing the annotation. CoordinateMode should be used to place watermarks, or annotations anchored to the top or bottom of the viewport etc…

 

box.coordMode= SCIAnnotationCoord_Relative;

 

The default is CoordinateMode.Absolute. In this mode, X1,Y1,X2,Y2 correspond to Data-values and the annotion position will update as you zoom and pan the chart.

 

CoordinateMode.Relative means that coordinates are relative to the viewport. The annotation does not update position as you zoom and pan. E.g. X1=0.0 and Y1=0.0 means the annotation will be placed in the top-left corner of the Viewport and X1=1.0, Y1=1.0 corresponds to the bottom-left corner of the viewport always (regardless of Zoom or Pan).

 

CoordinateMode.RelativeYmeans that Y-coordinates are relative to the viewport e.g. Y1=0.0 is top and Y1=1.0 is bottom, but X-coordinates are absolute (locked to data-values).

 

CoordinateMode.RelativeXmeans that X-coordinates are relative to the viewport e.g. X1=0.0 is left and X1=1.0 is right, but Y-coordinates are absolute.

X1,X2,Y1,Y2

X1,X2,Y1,Y2 define the actual coordinates of the Annotation.

 

XAxisId

In a multiple-axis scenario, AnnotationBase.XAxisId is used to bind the annotation to a specific X-Axis.

 

NOTE: This value must be supplied if you have axis with non-default Axis Ids.

YAxisId

In a multiple-axis scenario, AnnotationBase.YAxisId is used to bind the annotation to a specific Y-Axis.

 

NOTE:This value must be supplied if you have axis with non-default Axis Ids.

Editing Annotations via User Drag

All annotations support dragging and repositioning via touch.

 

See Also