syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.44k stars 672 forks source link

How do I set only one axis zoom depends on pinching direction. #1841

Closed keskink closed 1 week ago

keskink commented 2 weeks ago

Use case

I need to I set only one axis zoom depends on pinching direction. independent zoom x and y axis.

Proposal

I want to zoom only y axis when I pinch vertical or zoom only x axis when I pinch horizontal. may be can be this parameter on ZoomMode.independent

natrayansf commented 2 weeks ago

Hi keskink,

Currently, we do not have an option for your requirement of independent mode in zoomMode API in ZoomPanBehavior. However, we have prepared a workaround sample for your requirement of ‘How do I set only one axis zoom depending on pinching direction’ by overriding interaction callbacks in the ZoomPanBehavior and calculating the zoom position and zoom factor then deciding which axis gets tried to zoom with the help of horizontalScale and verticalScale and applying it to the respective axis. We have shared a workaround sample with a zooming demo for your reference below. Please let us know if you need any further needs.

We have shared the UG documentation below for your reference. https://help.syncfusion.com/flutter/cartesian-charts/zoom-pan

independent zooming.zip

Regards, Natrayan

keskink commented 2 weeks ago

Many thanks for your solution. All ok for me.

Thanks

LokeshPalani commented 1 week ago

Hi @keskink,

Most Welcome. Kindly get back to us if you have further queries. We are always happy to assist you.

Regards, Lokesh P.