ZoomPanBehavior class
Customizes the zooming options.
Customize the various zooming actions such as tap zooming, selection
zooming, zoom pinch. In selection zooming, you can long-press and drag to
select a range on the chart to be zoomed in and also you can customize the
selection zooming rectangle using selectionRectBorderWidth
,
selectionRectBorderColor
and selectionRectColor
properties.
Pinch zooming can be performed by moving two fingers over the chart.
Default mode is ZoomMode.xy. Zooming will be stopped after reaching
maximumZoomLevel
.
Note: This is only applicable for SfCartesianChart
.
Constructors
- ZoomPanBehavior({bool enablePinching = false, bool enableDoubleTapZooming = false, bool enablePanning = false, bool enableSelectionZooming = false, bool enableMouseWheelZooming = false, ZoomMode zoomMode = ZoomMode.xy, double maximumZoomLevel = 0.01, double selectionRectBorderWidth = 1, Color? selectionRectBorderColor, Color? selectionRectColor})
- Creating an argument constructor of ZoomPanBehavior class.
Properties
- enableDoubleTapZooming → bool
-
Enables or disables the double tap zooming.
final
- enableMouseWheelZooming → bool
-
Enables or disables the mouseWheelZooming.
final
- enablePanning → bool
-
Enables or disables the panning.
final
- enablePinching → bool
-
Enables or disables the pinch zooming.
final
- enableSelectionZooming → bool
-
Enables or disables the selection zooming.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- maximumZoomLevel → double
-
Maximum zoom level.
final
- parentBox ↔ RenderBox?
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionRectBorderColor → Color?
-
Border color of the selection zooming rectangle.
final
- selectionRectBorderWidth → double
-
Border width of the selection zooming rectangle.
final
- selectionRectColor → Color?
-
Color of the selection zooming rectangle.
final
- zoomMode → ZoomMode
-
By default, both the x and y-axes in the chart can be zoomed.
final
Methods
-
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).
-
handleHorizontalDragEnd(
DragEndDetails details) → void -
handleHorizontalDragStart(
DragStartDetails details) → void -
handleHorizontalDragUpdate(
DragUpdateDetails details) → void -
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.
inherited
-
handlePointerExit(
PointerExitEvent details) → void -
Called when a pointer or mouse exit on the screen.
inherited
-
handleScaleEnd(
ScaleEndDetails details) → void - Called when the pointers are no longer in contact with the screen.
-
handleScaleStart(
ScaleStartDetails details) → void - Called when the pointers in contact with the screen and initial scale of 1.0.
-
handleScaleUpdate(
ScaleUpdateDetails details) → void - Called when the pointers in contact with the screen have indicated a new scale.
-
handleTapDown(
TapDownDetails details) → void -
Called when the pointer tap has contacted the screen in behavior.
inherited
-
handleTapUp(
TapUpDetails details) → void -
Called when pointer has stopped contacting screen in behavior.
inherited
-
handleVerticalDragEnd(
DragEndDetails details) → void -
handleVerticalDragStart(
DragStartDetails details) → void -
handleVerticalDragUpdate(
DragUpdateDetails details) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPaint(
PaintingContext context, Offset offset, SfChartThemeData chartThemeData, ThemeData themeData) → void - Called to customize each behaviors with given context at the given offset.
-
panToDirection(
String direction) → void - Pans the plot area for given left, right, top, and bottom directions.
-
reset(
) → void - Returns the plot area back to its original position after zooming.
-
toString(
) → String -
A string representation of this object.
inherited
-
zoomByFactor(
double zoomFactor) → void - Changes the zoom level using zoom factor.
-
zoomByRect(
Rect rect) → void - Zooms the chart for a given rectangle value.
-
zoomIn(
) → void - Increases the magnification of the plot area.
-
zoomOut(
) → void - Decreases the magnification of the plot area.
-
zoomToSingleAxis(
ChartAxis axis, double zoomPosition, double zoomFactor) → void - Change the zoom level of an appropriate axis.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override