iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
SCIAnnotationBase
@interface SCIAnnotationBase
: NSObject <ISCIAnnotation, ISCIChartSurfaceProvider>
Provides a base class for annotations to be rendered over the chart.
-
Defines the
SCIAnnotationCoordinateModeto use when placing the annotation.Note
E.g. the default Absolute requires thatX1, Y1, X2, Y2are data-values. The Relative requires thatX1, Y1, X2, Y2are double values from 0.0 to 1.0.Declaration
Objective-C
@property (nonatomic) SCIAnnotationCoordinateMode coordinateMode;Swift
var coordinateMode: SCIAnnotationCoordinateMode { get set } -
Defines the
z-indexposition for this annotation.Declaration
Objective-C
@property (nonatomic) int zIndex;Swift
var zIndex: Int32 { get set } -
Defines the
ISCIResizingGripinstance for this annotation.Declaration
Objective-C
@property (nonatomic, strong) id<ISCIResizingGrip> _Nonnull resizingGrip;Swift
var resizingGrip: any ISCIResizingGrip { get set } -
Defines the
ISCIAnnotationSelectionDrawableinstance for this annotation.Declaration
Objective-C
@property (nonatomic, strong) id<ISCIAnnotationSelectionDrawable> _Nonnull annotationSelectionDrawable;Swift
var annotationSelectionDrawable: any ISCIAnnotationSelectionDrawable { get set } -
Defines if a annotation should be clipped to it’s parrent
annotation surface.Declaration
Objective-C
@property (nonatomic) BOOL clipAdornerToAnnotationSurface;Swift
var clipAdornerToAnnotationSurface: Bool { get set } -
Provide the index of the annotation point (e.g., a corner or edge handle) currently being used for resizing.*
Declaration
Objective-C
@property (nonatomic, readonly) SCIAnnotationPointIndex resizingGripIndex;Swift
var resizingGripIndex: SCIAnnotationPointIndex { get } -
Determines whether the coordinate is valid for placing on the canvas, e.g. is greater than zero and less than
canvasMeasurement.Declaration
Objective-C
- (BOOL)isCoordinateValid:(CGFloat)coord withSize:(CGFloat)size;Swift
func isCoordinateValid(_ coord: CGFloat, withSize size: CGFloat) -> BoolParameters
coordthe coordinate.
sizeThe canvas dimension in this axis.
Return Value
YES - if coordinate is valid, otherwise - NO.
-
Gets the position of resizing grip with specified index
Declaration
Objective-C
- (CGPoint)getResizingGripPositionFor: (SCIAnnotationPointIndex)resizingGripIndex;Swift
func getResizingGripPosition(for resizingGripIndex: SCIAnnotationPointIndex) -> CGPointParameters
resizingGripIndexIndex of resizing grip
Return Value
Position of resizing grip
-
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyBool *isEditablePropertySwift
var isEditableProperty: SCISmartPropertyBool { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyBool *isSelectedPropertySwift
var isSelectedProperty: SCISmartPropertyBool { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyBool *isHiddenPropertySwift
var isHiddenProperty: SCISmartPropertyBool { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *xAxisIdPropertySwift
var xAxisIdProperty: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *yAxisIdPropertySwift
var yAxisIdProperty: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *x1PropertySwift
var x1Property: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *y1PropertySwift
var y1Property: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *x2PropertySwift
var x2Property: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *y2PropertySwift
var y2Property: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyInt *annotationSurfacePropertySwift
var annotationSurfaceProperty: SCISmartPropertyInt { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyInt *coordinateModePropertySwift
var coordinateModeProperty: SCISmartPropertyInt { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyInt *dragDirectionsPropertySwift
var dragDirectionsProperty: SCISmartPropertyInt { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyInt *resizeDirectionsPropertySwift
var resizeDirectionsProperty: SCISmartPropertyInt { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *resizingGripPropertySwift
var resizingGripProperty: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartProperty *selectionDrawablePropertySwift
var selectionDrawableProperty: SCISmartProperty { get set } -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic) SCISmartPropertyInt *zIndexPropertySwift
var zIndexProperty: SCISmartPropertyInt { get set } -
Undocumented
Declaration
Objective-C
- (void)initializeProperties;Swift
func initializeProperties() -
Undocumented
See moreDeclaration
Objective-C
@property (strong, nonatomic, readonly) SCIAnnotationCoordinates *annotationCoordinatesSwift
var annotationCoordinates: SCIAnnotationCoordinates { get } -
Gets the annotation surface bounds for this annotation.
See moreDeclaration
Objective-C
@property (nonatomic) CGRect parentSurfaceFrame;Swift
var parentSurfaceFrame: CGRect { get set } -
Gets the Adorner Layer to place annotation adorners.
See moreDeclaration
Objective-C
@property (nonatomic, weak, nullable) id<ISCIAdornerLayer> adornerLayer;Swift
weak var adornerLayer: (any ISCIAdornerLayer)? { get set } -
Called when XAxis Id changes.
Declaration
Objective-C
- (void)onXAxisIdChanged;Swift
func onXAxisIdChanged() -
Called when YAxis Id changes.
Declaration
Objective-C
- (void)onYAxisIdChanged;Swift
func onYAxisIdChanged() -
Updates the coordinate calculators and refreshes the annotation position on the parent
ISCIChartSurface.Declaration
Objective-C
- (void)updateWithXCoordinateCalculator: (nullable id<ISCICoordinateCalculator>)xCalc andYCoordinateCalculator: (nullable id<ISCICoordinateCalculator>)yCalc;Swift
func update(withXCoordinateCalculator xCalc: (any ISCICoordinateCalculator)?, andYCoordinateCalculator yCalc: (any ISCICoordinateCalculator)?)Parameters
xCalcThe current
ISCICoordinateCalculatorfor XAxis.yCalcThe current
ISCICoordinateCalculatorfor YAxis. -
Updates the
SCIAnnotationCoordinatesinstance associated with this annotation.Declaration
Objective-C
- (void)updateAnnotationCoordinates: (nonnull SCIAnnotationCoordinates *)annotationCoordinates insideFrame:(CGRect)frame xCoordinateCalculator:(nullable id<ISCICoordinateCalculator>)xCalc andYCoordinateCalculator: (nullable id<ISCICoordinateCalculator>)yCalc;Swift
func updateAnnotationCoordinates(_ annotationCoordinates: SCIAnnotationCoordinates, insideFrame frame: CGRect, xCoordinateCalculator xCalc: (any ISCICoordinateCalculator)?, andYCoordinateCalculator yCalc: (any ISCICoordinateCalculator)?)Parameters
annotationCoordinatesThe
SCIAnnotationCoordinatesto update.frameThe parent annotation surface frame.
xCalcThe current
ISCICoordinateCalculatorfor XAxis.yCalcThe current
ISCICoordinateCalculatorfor YAxis. -
Attaches associated
ISCIAdornerProviderto the parentISCIAdornerLayer.Declaration
Objective-C
- (void)attachAdorners:(nonnull id<ISCIAdornerLayer>)adornerLayer;Swift
func attachAdorners(_ adornerLayer: any ISCIAdornerLayer)Parameters
adornerLayerThe parent
ISCIAdornerLayer. -
Detaches associated
ISCIAdornerProviderfrom the parentISCIAdornerLayer.Declaration
Objective-C
- (void)detachAdorners:(nonnull id<ISCIAdornerLayer>)adornerLayer;Swift
func detachAdorners(_ adornerLayer: any ISCIAdornerLayer)Parameters
adornerLayerThe parent
ISCIAdornerLayer. -
Checks whether specified point is within annotation’s bounds.
Declaration
Objective-C
- (BOOL)isPointWithinBounds:(CGPoint)point;Swift
func isPoint(withinBounds point: CGPoint) -> BoolParameters
pointThe x-y coordinates to check.
Return Value
YES - if point is within annotation’s bounds.
-
Draws the annotation using the
ISCIRenderContext2Dand theISCIAssetManager2D.Declaration
Objective-C
- (void)internalDrawWithContext:(nonnull id<ISCIRenderContext2D>)renderContext assetManager:(nonnull id<ISCIAssetManager2D>)assetManager atCoordinates:(nonnull SCIAnnotationCoordinates *)coordinates;Swift
func internalDraw(with renderContext: any ISCIRenderContext2D, assetManager: any ISCIAssetManager2D, at coordinates: SCIAnnotationCoordinates)Parameters
renderContextThe render context. This is a graphics object which has methods to draw lines, quads and polygons to the screen.
assetManagerThe asset manager. This is manager for graphic assets which has method for creation pens, brushes and textures.
coordinatesThe annotation coordinates.
-
Draws this annotation on apporpriate axis (depends on annotationSurface) using the
ISCIRenderContext2Dand theISCIAssetManager2D.Declaration
Objective-C
- (void) internalDrawOnAxisWithContext:(nonnull id<ISCIRenderContext2D>)renderContext assetManager:(nonnull id<ISCIAssetManager2D>)assetManager atCoordinates: (nonnull SCIAnnotationCoordinates *)coordinates;Swift
func internalDrawOnAxis(with renderContext: any ISCIRenderContext2D, assetManager: any ISCIAssetManager2D, at coordinates: SCIAnnotationCoordinates)Parameters
renderContextThe render context. This is a graphics object which has methods to draw lines, quads and polygons to the screen.
assetManagerThe asset manager. This is manager for graphic assets which has method for creation pens, brushes and textures.
coordinatesThe annotation coordinates.
-
Draws adorner for annotation within the passed-in rectangle.
Declaration
Objective-C
- (void)internalDrawAdornerOnCGContext:(nonnull CGContextRef)context inRect:(CGRect)rect atCoordinates: (nonnull SCIAnnotationCoordinates *)coordinates;Swift
func internalDrawAdorner(on context: CGContext, in rect: CGRect, at coordinates: SCIAnnotationCoordinates)Parameters
rectThe portion of the view’s bounds to draw adorner in.
coordinatesThe annotation coordinates.
-
Draws selection overlay for this annotation.
Declaration
Objective-C
- (void)internalDrawSelectionOverlayOnCGContext:(nonnull CGContextRef)context inRect:(CGRect)rect atCoordinates: (nonnull SCIAnnotationCoordinates *) coordinates;Swift
func internalDrawSelectionOverlay(on context: CGContext, in rect: CGRect, at coordinates: SCIAnnotationCoordinates)Parameters
rectThe portion of the view’s bounds to draw selection overlay grips in.
coordinatesThe annotation coordinates..
-
Draws resizing grips for this annotation.
Declaration
Objective-C
- (void)internalDrawResizingGripsOnCGContext:(nonnull CGContextRef)context inRect:(CGRect)rect atCoordinates: (nonnull SCIAnnotationCoordinates *) coordinates;Swift
func internalDrawResizingGrips(on context: CGContext, in rect: CGRect, at coordinates: SCIAnnotationCoordinates)Parameters
contextThe
CGContextto draw resizing grip on.rectThe portion of the view’s bounds to draw resizing grips in.
coordinatesThe annotation coordinates.
-
Updates the shape of selection overlay.
Declaration
Objective-C
- (void)updateSelectionOverlayPath:(nonnull CGMutablePathRef)selectionPath atCoordinates: (nonnull SCIAnnotationCoordinates *)coordinates;Swift
func updateSelectionOverlayPath(_ selectionPath: CGMutablePath, at coordinates: SCIAnnotationCoordinates)Parameters
selectionPathThe
CGMutablePathinstance to update.coordinatesThe annotation coordinates.
-
Notifies
ISCIAnnotationDragListenerabout start of drag operation,Declaration
Objective-C
- (void)notifyOnDragStarted;Swift
func notifyOnDragStarted() -
Notifies
ISCIAnnotationDragListenerabout drag operation.Declaration
Objective-C
- (void)notifyOnDragByXDelta:(CGFloat)xDelta yDelta:(CGFloat)yDelta;Swift
func notifyOnDrag(byXDelta xDelta: CGFloat, yDelta: CGFloat)Parameters
xDeltaThe horizontal offset in pixels.
yDeltaThe vertical offset in pixels.
-
Notifies
ISCIAnnotationDragListenerabout end of drag operation,Declaration
Objective-C
- (void)notifyOnDragEnded;Swift
func notifyOnDragEnded() -
Creates
ISCIAnnotationAdornerActionwhich is used in case of hit on annotation’s resizing grip.Declaration
Objective-C
- (nullable id<ISCIAnnotationAdornerAction>) createAdornerActionForResizingGripWithIndex:(SCIAnnotationPointIndex)index offset:(CGPoint)offset;Swift
func createAdornerActionForResizingGrip(with index: SCIAnnotationPointIndex, offset: CGPoint) -> (any ISCIAnnotationAdornerAction)?Parameters
indexThe index of resizing grip which was hit.
offsetThe initial offset for resizing grip.
Return Value
The
ISCIAnnotationAdornerActioninstance to handle resizing grip hit with specified index. -
Creates
ISCIAnnotationAdornerActionwhich is used in case of hit on annotation.Declaration
Objective-C
- (nullable id<ISCIAnnotationAdornerAction>)createAdornerActionForAnnotationHit;Swift
func createAdornerActionForAnnotationHit() -> (any ISCIAnnotationAdornerAction)?Return Value
The
ISCIAnnotationAdornerActioninstance to handle annotation hit. -
Selects the
ISCIAnnotationAdornerActionfor specified point onISCIAdornerLayer.Declaration
Objective-C
- (nullable id<ISCIAnnotationAdornerAction>) selectAdornerActionForPoint:(CGPoint)point relativeTo:(nonnull id<ISCIAdornerLayer>)adornerLayer;Swift
func selectAdornerAction(for point: CGPoint, relativeTo adornerLayer: any ISCIAdornerLayer) -> (any ISCIAnnotationAdornerAction)?Parameters
pointThe point on the adorner layer.
adornerLayerThe adorner layer.
Return Value
The
ISCIAnnotationAdornerActionif it is required for specified point, otherwise nil. -
Gets the index of
ISCIResizingGripfor parent annotation at specified point on screen.Declaration
Objective-C
- (SCIAnnotationPointIndex)getResizingGripHitIndexAt:(CGPoint)hitPoint andAnnotationCoordinates: (nonnull SCIAnnotationCoordinates *) annotationCoordinates;Swift
func getResizingGripHitIndex(at hitPoint: CGPoint, andAnnotationCoordinates annotationCoordinates: SCIAnnotationCoordinates) -> SCIAnnotationPointIndexParameters
hitPointThe coordinates of hit-test point in pixels.
annotationCoordinatesThe
SCIAnnotationCoordinatesinstance associated with parent annotation.Return Value
The index of
ISCIResizingGripwhich lies below hit test point, otherwise returns -1 which indicates that there is notISCIResizingGripat specified hit test point. -
Moves parent annotation in X, Y direction with specified offset in pixels.
Declaration
Objective-C
- (void)internalMoveByXDelta:(CGFloat)xDelta yDelta:(CGFloat)yDelta withCoordinates:(nonnull SCIAnnotationCoordinates *)coordinates insideFrame:(CGRect)frame;Swift
func internalMove(byXDelta xDelta: CGFloat, yDelta: CGFloat, with coordinates: SCIAnnotationCoordinates, insideFrame frame: CGRect)Parameters
xDeltaThe horizontal offset in pixels.
yDeltaThe vertical offset in pixels.
coordinatesThe annotation coordinates.
frameThe parent annotation surface frame.
-
This method is used in internally to set an adorner point position.
Declaration
Objective-C
- (void)moveBasePointTo:(CGPoint)point atIndex:(SCIAnnotationPointIndex)index xAxis:(nonnull id<ISCIAxis>)xAxis andYAxis:(nonnull id<ISCIAxis>)yAxis;Swift
func movePoint(to point: CGPoint, at index: SCIAnnotationPointIndex, xAxis: any ISCIAxis, andYAxis yAxis: any ISCIAxis)Parameters
pointThe new coordinates of base point in pixels.
indexThe index of base point to move.
xAxisThe current XAxis instance.
yAxisThe current YAxis instance.
-
-getPointCoordinatesFromXValue:yValue:insideFrame:withXCoordinateCalculator:andYCoordinateCalculator:Updates coordinate point based on provided values.
Declaration
Objective-C
- (CGPoint) getPointCoordinatesFromXValue:(nonnull id<ISCIComparable>)xValue yValue:(nonnull id<ISCIComparable>)yValue insideFrame:(CGRect)frame withXCoordinateCalculator:(nullable id<ISCICoordinateCalculator>)xCalc andYCoordinateCalculator:(nullable id<ISCICoordinateCalculator>)yCalc;Swift
func getPointCoordinates(fromXValue xValue: any ISCIComparable, yValue: any ISCIComparable, insideFrame frame: CGRect, withXCoordinateCalculator xCalc: (any ISCICoordinateCalculator)?, andYCoordinateCalculator yCalc: (any ISCICoordinateCalculator)?) -> CGPointParameters
xValueThe X Data-value.
yValueThe Y Data-value.
frameThe parent annotation surface frame.
xCalcThe current
ISCICoordinateCalculatorfor XAxis.yCalcThe current
ISCICoordinateCalculatorfor YAxis.Return Value
The calculated annotation coordinate point.
-
Converts a data value to pixel coordinate.
Declaration
Objective-C
- (CGFloat)toCoordinateFrom:(nonnull id<ISCIComparable>)dataValue canvasMeasurement:(int)canvasMeasurement coordinateCalculator:(nullable id<ISCICoordinateCalculator>)coordCalc andDirection:(SCIDirection2D)direction;Swift
func toCoordinate(from dataValue: any ISCIComparable, canvasMeasurement: Int32, coordinateCalculator coordCalc: (any ISCICoordinateCalculator)?, andDirection direction: SCIDirection2D) -> CGFloatParameters
dataValueThe data value to convert.
canvasMeasurementThe size of
ISCIAnnotationSurface.coordCalcThe current
ISCICoordinateCalculator.directionThe X or Y direction for the transformation.
Return Value
The converted pixel coordinates.
-
Converts a pixel coordinate to data-value.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)fromCoordinate:(CGFloat)coord withAxis:(nonnull id<ISCIAxis>)axis;Swift
func fromCoordinate(_ coord: CGFloat, with axis: any ISCIAxis) -> any ISCIComparableParameters
coordThe pixel coordinate.
axisThe axis for which the data value is calculated.
Return Value
The converted data-value.
-
Converts a relative coordinate (e.g. 0.0 to 1.0) to data-value.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)fromRelativeCoordinate:(CGFloat)coord withAxis:(nonnull id<ISCIAxis>)axis;Swift
func fromRelativeCoordinate(_ coord: CGFloat, with axis: any ISCIAxis) -> any ISCIComparableParameters
coordThe relative coordinate, in the range of 0.0 to 1.0 for extremes of the viewport.
axisThe axis for which the data value is calculated.
Return Value
The converted data-value.
-
Sets X and Y Value for base point with specified index.
Declaration
Objective-C
- (void)setXValue:(nonnull id<ISCIComparable>)xValue yValue:(nonnull id<ISCIComparable>)yValue fromIndex:(SCIAnnotationPointIndex)index;Swift
func setXValue(_ xValue: any ISCIComparable, yValue: any ISCIComparable, from index: SCIAnnotationPointIndex)Parameters
xValueThe X Value to set.
yValueThe Y Value to set.
indexThe index of base point to set.
-
This method is used in internally to modify an adorner point position.
Declaration
Objective-C
- (void)modifyPoint:(CGPoint)point atIndex:(SCIAnnotationPointIndex)index xAxis:(nonnull id<ISCIAxis>)xAxis andYAxis:(nonnull id<ISCIAxis>)yAxis;Swift
func modifyPoint(_ point: CGPoint, at index: SCIAnnotationPointIndex, xAxis: any ISCIAxis, andYAxis yAxis: any ISCIAxis)Parameters
pointThe new coordinates of base point in pixels.
indexThe index of base point to move.
xAxisThe current XAxis instance.
yAxisThe current YAxis instance.
View on GitHub