Closed DrNiels closed 4 months ago
Hi @DrNiels,
We can reproduce the reported issue regarding the 'Selected range is not updated correctly when zooming' at our end. We will fix and include this issue in our upcoming weekly patch release, which is expected to be rolled out on April 16, 2024. We will notify you once it has been rolled out. We appreciate your patience until then.
Regards, Lokesh P.
Hi @DrNiels,
We have reviewed your query and we would like to let you know that, we have considered the maximumZoomLevel property within the zoom pan behavior while doing selection zooming. This property is initialized with a default value of 0.01, and its representing the maximum zoom level. If the chart's zooming level falls below this value, chart's zooming level value will be the maximumZoomLevel value.
To achieve your desired outcome, you can set the maximumZoomLevel value to 0 in ZoomPanBehavior. We have shared the code snippet and modified dart file below for your reference.
Code snippet:
zoomPanBehavior: ZoomPanBehavior(
enablePinching: true,
enableMouseWheelZooming: true,
enableSelectionZooming: true,
zoomMode: ZoomMode.x,
// handle maximumZoomLevel here.
maximumZoomLevel: 0,
),
Regards, Lokesh P.
Setting maximumZoomLevel to 0 did the trick for me, thank you!
When I try to zoom via mouse wheel or selection zooming, the resulting new range is not correct. In my tests, this seemed to work fine, when initialVisibleMinimum and -Maximum are not set or when a NumericAxis is used.
Consider the following example:
You can see the error in action here:![incorrect-zoom](https://github.com/syncfusion/flutter-widgets/assets/29275341/3874a8e1-0169-44ab-b5f3-0efd40ff86b3)
I try to zoom to the 24th to 25th February, but the resulting range is from ~24th February to ~24th May. The start could be correct, but the end is definitely wrong.
Output of flutter doctor:
I use syncfusion_flutter_charts in version 25.1.35 and on Web