iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
SCIExtendedLineCreationModifier
The SCIExtendedLineCreationModifier is a custom gesture modifier used for interactive creation of Extended Line annotations on a SciChart surface. It enables users to define a line with two anchor points using a pan gesture workflow, with options to extend the line forward, backward, or both directions beyond its anchors.
Overview
The modifier manages the full lifecycle of extended line creation:
- Two-step gesture interaction (A → B)
- Real-time rendering while dragging points
- Automatic annotation finalization after point B is set
- Immediate reset for continuous creation of multiple extended lines
- Configurable line extension behavior (both directions, forward, backward, or none)
Once completed, the annotation is added to the chart and a completion callback is triggered.
Interaction Behavior
The creation flow is split into two sequential pan gestures.
Gesture Flow (A → B)
| Gesture | Behavior |
|---|---|
| Touch Down | Locks point A at touch location |
| Drag | Dynamically updates point B |
| Touch Up | Finalizes A and B, transitions to waiting state |
Completion
- After point B is set, a
SCIExtendedLineAnnotationis created - The
annotationCreationCompletionListenercallback is invoked - The modifier automatically resets to Idle and is ready for the next line
Retrieving Annotation Data
After completion, the resulting SCIExtendedLineAnnotation provides direct access to its defining anchor points in data space.
Point Accessors
-[ISCIAnnotation getX1] / -[ISCIAnnotation getY1] and [ISCIAnnotation getX2] / -[ISCIAnnotation getY2]
Returns the first anchor point (A) and the second anchor point (B) in data coordinates.
Values correspond to the chart’s X‑Axis and Y‑Axis units.
API Reference
| Field | Description |
|---|---|
SCIExtendedLineCreationModifier.stroke |
Pen style used to draw the extended line. |
SCIExtendedLineCreationModifier.extendStart |
Boolean flag controlling backward extension of the line. |
SCIExtendedLineCreationModifier.extendEnd |
Boolean flag controlling forward extension of the line. |
-[SCIExtendedLineCreationModifier reset] |
Cancels any in‑progress gesture and returns the modifier to Idle. |
NOTE: The xAxisId and yAxisId must be supplied if you have axis with non-default Axis Ids, e.g. in multi-axis scenario.
Usage Example
Best Practices
- Disable conflicting gesture modifiers during extended line creation for smoother interaction
- Use
SCIAnnotationCreationModifierBase.annotationCreationCompletionListenerto persist or analyze completed annotations - Call
-[SCIExtendedLineCreationModifier reset]when switching tools or exiting drawing mode - Configure extendStart and extendEnd to match the desired line extension behavior
View on GitHub