Skip to content

Commit 7f3be4e

Browse files
author
LavanyaA
authored
Merge pull request #1236 from syncfusion-content/FLUT-962617-Directional-Zooming-UG-Content
FLUT-962617 - [Feature] UG content for Directional Zooming
2 parents 7c543c3 + b9bb2ca commit 7f3be4e

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
487 KB
Loading

Flutter/cartesian-charts/zoom-pan.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,52 @@ Pinch zooming can be enabled by [`enablePinching`](https://pub.dev/documentation
4848
{% endhighlight %}
4949
{% endtabs %}
5050

51+
## Directional zooming
52+
53+
The directional zooming feature improves the zoom experience by allowing users to zoom in and out in a specific direction (horizontal, vertical, or diagonal) based on their finger gesture. To enable this feature, set the [`enableDirectionalZooming`]() property to `true`, the default value is `false`. The following code sample demonstrates how to enable directional zooming.
54+
55+
{% tabs %}
56+
{% highlight dart hl_lines="7" %}
57+
58+
late ZoomPanBehavior _zoomPanBehavior;
59+
60+
@override
61+
void initState(){
62+
_zoomPanBehavior = ZoomPanBehavior(
63+
// Enables directional zooming
64+
enableDirectionalZooming: true,
65+
enablePinching: true,
66+
zoomMode: ZoomMode.xy,
67+
);
68+
super.initState();
69+
}
70+
71+
@override
72+
Widget build(BuildContext context) {
73+
return Scaffold(
74+
body: SafeArea(
75+
child: Center(
76+
child: Container(
77+
height: 300,
78+
width: 350,
79+
child: SfCartesianChart(
80+
zoomPanBehavior: _zoomPanBehavior
81+
)
82+
)
83+
)
84+
)
85+
);
86+
}
87+
88+
{% endhighlight %}
89+
{% endtabs %}
90+
91+
>**Note**:
92+
* Directional zooming functions when both [`enableDirectionalZooming`]() and [`enablePinching`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ZoomPanBehavior/enablePinching.html) are set to `true`.
93+
* This feature is intended for touch gestures and is ineffective with a mouse or track pad-based interactions.
94+
95+
![Directional Zooming](images/zooming-panning/directional_zooming.gif)
96+
5197
## Double tap zooming
5298

5399
Double tap zooming can be enabled using [`enableDoubleTapZooming`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ZoomPanBehavior/enableDoubleTapZooming.html) property. Defaults to `false`.

0 commit comments

Comments
 (0)