Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 3.58 KB

File metadata and controls

47 lines (36 loc) · 3.58 KB
uid annotationsAPIs.PitchforkAnnotationCreationModifier

The 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.

Overview

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.

Properties

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.

Event Listeners

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.

Using PitchforkAnnotationCreationModifier

The following code demonstrates how to add and configure a PitchforkAnnotationCreationModifier:

[!code-javaAddPitchforkAnnotationCreationModifier]

[!code-swiftAddPitchforkAnnotationCreationModifier]


Customizing the Modifier

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.