iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
SCIPitchforkCreationModifier
The SCIPitchforkCreationModifier is a custom gesture modifier used for interactive creation of Pitchfork annotations on a SciChart surface.
It enables users to define a pitchfork using a two-stage pan gesture workflow, producing a SCIPitchforkAnnotation with real-time visual feedback during construction.
Overview
The modifier manages the full lifecycle of pitchfork creation:
- Two-step gesture interaction (A → B → C)
- Real-time rendering while dragging points
- Automatic annotation finalization after point C is set
- Immediate reset for continuous creation of multiple pitchforks
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.
State Machine
| State | Description |
|---|---|
SCIPitchforkCreationStateIdle |
Waiting for first touch input |
SCIPitchforkCreationStateDrawingAB |
Point A is locked, user is dragging to define B |
SCIPitchforkCreationStateWaitingForC |
A and B are locked, waiting for second gesture |
SCIPitchforkCreationStateDrawingC |
User is dragging to define C; pitchfork updates live |
Gesture Flow (A → B → C)
1. First Pan Gesture (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 |
2. Second Pan Gesture ©
| Gesture | Behavior |
|---|---|
| Touch Down | Begins defining point C |
| Drag | Pitchfork updates in real time with C movement |
| Touch Up | Finalizes annotation and completes creation |
Completion
- After point C is set, a
SCIPitchforkAnnotationis created - The
SCIAnnotationCreationModifierBase.annotationCreationCompletionListenercallback is invoked - The modifier automatically resets to
Idleand is ready for the next pitchfork
Retrieving Annotation Data
After completion, the resulting SCIPitchforkAnnotation contains the defining points of the structure.
You can extract its geometry using base data methods exposed by the annotation:
-[ISCITradingAnnotation getBaseDataValues]
- Values correspond to chart axis coordinates
- Best for storage, analytics, and reconstruction
-[ISCITradingAnnotation getBasePoints]
- Values correspond to rendered screen coordinates
- Useful for UI overlays and screen-level calculations
API Reference
| Field | Description |
|---|---|
SCIPitchforkCreationModifier.halfWidthZoneFill |
Fill colour for the central (middle) polygon section. |
SCIPitchforkCreationModifier.fullWidthZoneFill |
Fill colour for the two outer polygon sections. |
SCIPitchforkCreationModifier.tineStroke |
The pen style used to draw the four tine lines. |
SCIPitchforkCreationModifier.mainStroke |
The pen style used to draw the main pivot line. |
SCIPitchforkCreationModifier.creationState |
Current state of the pitchfork creation lifecycle. |
-[SCIPitchforkCreationModifier 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 pitchfork creation for smoother interaction
- Use
SCIAnnotationCreationModifierBase.annotationCreationCompletionListenerto persist or analyze completed annotations - Call
-[SCIPitchforkCreationModifier reset]when switching tools or exiting drawing mode - Use distinct styling for pitchfork annotations to improve chart readability
Notes
- Only one pitchfork is created per interaction cycle
- The modifier automatically resets after completion
- Designed for financial charting tools where trend structure visualization is required
View on GitHub