CrosshairBehavior class

This class has the properties of the crosshair behavior.

Crosshair behavior has the activation mode and line type property to set the behavior of the crosshair. It also has the property to customize the appearance.

Provide options for activation mode, line type, line color, line width, hide delay for customizing the behavior of the crosshair.

Annotations

Constructors

CrosshairBehavior({ActivationMode activationMode = ActivationMode.longPress, CrosshairLineType lineType = CrosshairLineType.both, List<double>? lineDashArray, bool enable = false, Color? lineColor, double lineWidth = 1, bool shouldAlwaysShow = false, double hideDelay = 0})
Creating an argument constructor of CrosshairBehavior class.

Properties

activationMode ActivationMode
Gesture for activating the crosshair.
final
enable bool
Toggles the visibility of the crosshair.
final
hashCode int
The hash code for this object.
no setteroverride
hideDelay double
Time delay for hiding the crosshair.
final
lineColor Color?
Color of the crosshair line.
final
lineDashArray List<double>?
Dashes of the crosshair line.
final
lineType CrosshairLineType
Type of crosshair line.
final
lineWidth double
Width of the crosshair line.
final
parentBox RenderBox?
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldAlwaysShow bool
Enables or disables the crosshair.
final

Methods

drawHorizontalAxisLine(PaintingContext context, Offset offset, List<double>? dashArray, Paint paint) → void
Override this method to customize the horizontal line drawing and styling.
drawHorizontalAxisTooltip(PaintingContext context, Offset position, String text, TextStyle style, [Path? path, Paint? fillPaint, Paint? strokePaint]) → void
Override this method to customize the horizontal axis tooltip with styling and it's position.
drawVerticalAxisLine(PaintingContext context, Offset offset, List<double>? dashArray, Paint paint) → void
Override this method to customize the vertical line drawing and styling.
drawVerticalAxisTooltip(PaintingContext context, Offset position, String text, TextStyle style, [Path? path, Paint? fillPaint, Paint? strokePaint]) → void
Override this method to customize the vertical axis tooltip with styling and it's position.
handleDoubleTap(Offset position) → void
Called when pointer tap has contacted the screen double time in behavior.
handleEvent(PointerEvent event, BoxHitTestEntry entry) → void
To customize the necessary pointer events in behaviors. (e.g., CrosshairBehavior, TrackballBehavior, ZoomingBehavior).
handleLongPressEnd(LongPressEndDetails details) → void
Called when the pointer stops contacting the screen after a long-press by a primary button in behavior.
handleLongPressMoveUpdate(LongPressMoveUpdateDetails details) → void
Called when moving after the long press gesture by a primary button is recognized in behavior.
handleLongPressStart(LongPressStartDetails details) → void
Called when a long press gesture by a primary button has been recognized in behavior.
handlePointerEnter(PointerEnterEvent details) → void
Called when a pointer or mouse enter on the screen.
handlePointerExit(PointerExitEvent details) → void
Called when a pointer or mouse exit on the screen.
handleScaleEnd(ScaleEndDetails details) → void
Called when the pointers are no longer in contact with the screen.
inherited
handleScaleStart(ScaleStartDetails details) → void
Called when the pointers in contact with the screen and initial scale of 1.0.
inherited
handleScaleUpdate(ScaleUpdateDetails details) → void
Called when the pointers in contact with the screen have indicated a new scale.
inherited
handleTapDown(TapDownDetails details) → void
Called when the pointer tap has contacted the screen in behavior.
handleTapUp(TapUpDetails details) → void
Called when pointer has stopped contacting screen in behavior.
hide() → void
Hides the crosshair if it is displayed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onPaint(PaintingContext context, Offset offset, SfChartThemeData chartThemeData, ThemeData themeData) → void
Override this method to customize the crosshair tooltips & line rendering.
show(dynamic x, double y, [String coordinateUnit = 'point']) → void
Displays the crosshair at the specified x and y-positions.
showByIndex(int pointIndex) → void
Displays the crosshair at the specified point index.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override