Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 3.54 KB

File metadata and controls

45 lines (34 loc) · 3.54 KB
uid annotationsAPIs.BrushAnnotationCreationModifier

The BrushAnnotationCreationModifier

The xref:com.scichart.charting.modifiers.BrushAnnotationCreationModifier is a chart modifier that allows for freehand creation of xref:com.scichart.charting.visuals.annotations.tradingAnnotations.BrushAnnotation instances.

Overview

When this modifier is enabled and added to a xref:com.scichart.charting.visuals.SciChartSurface, users can draw freehand strokes directly on the chart using touch gestures. The modifier automatically creates a new BrushAnnotation and populates it with points based on the user's movement.

Properties

The following properties can be used to configure the BrushAnnotationCreationModifier:

Property Description
brushColor Sets the color of the brush stroke for the annotations created by this modifier.
brushThickness Sets the thickness of the brush stroke for the annotations created by this modifier.
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.

Event Listeners

You can receive a notification when an annotation is created by setting an xref:com.scichart.charting.modifiers.OnAnnotationCreatedListener:

  • setAnnotationCreationListener(OnAnnotationCreatedListener listener): Passes the newly created annotation instance to the listener.

Using BrushAnnotationCreationModifier

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

[!code-javaAddBrushAnnotationCreationModifier]

[!code-swiftAddBrushAnnotationCreationModifier]


Customizing the Modifier

You can customize the behavior of the BrushAnnotationCreationModifier by extending it and overriding its touch event methods. This allows you to add custom logic before or after an annotation is created.

[!code-javaCustomBrushAnnotationCreationModifier]

[!code-swiftCustomBrushAnnotationCreationModifier]


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.