| uid | annotationsAPIs.PitchforkAnnotationCreationModifier |
|---|
The xref:com.scichart.charting.modifiers.PitchforkAnnotationCreationModifier is a chart modifier that allows for interactive creation of xref:com.scichart.charting.visuals.annotations.tradingAnnotations.PitchforkAnnotation instances using a 3-tap workflow.
When this modifier is enabled, users can place the 3 required points (Handle, High, Low) by tapping on the chart.
- Each tap confirms the position of the next point.
- A "rubber-band" dashed line provides a preview of the next segment between the last confirmed point and the current touch position.
- Once the third point is placed, the annotation is finalized, and the modifier automatically resets to create the next one.
The following properties can be used to configure the PitchforkAnnotationCreationModifier:
| Property | Description |
|---|---|
| xAxisId | Sets the ID of the X-Axis that the created annotations should be measured against. |
| yAxisId | Sets the ID of the Y-Axis that the created annotations should be measured against. |
| rubberBandStroke | Sets the pen style for the preview line shown during creation. |
You can receive a notification when an annotation is fully created by setting an xref:com.scichart.charting.modifiers.OnAnnotationCreatedListener:
- setAnnotationCreationListener(OnAnnotationCreatedListener listener): Passes the newly created annotation instance to the listener.
The following code demonstrates how to add and configure a PitchforkAnnotationCreationModifier:
[!code-javaAddPitchforkAnnotationCreationModifier]
[!code-swiftAddPitchforkAnnotationCreationModifier]
The PitchforkAnnotationCreationModifier is designed for extensibility. You can customize its behavior by extending it and overriding its protected methods.
[!code-javaCustomPitchforkAnnotationCreationModifier]
[!code-swiftCustomPitchforkAnnotationCreationModifier]
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.