Selection zooming vs panning
When using Selection zooming function and ZoomToolbar user need to manually switch between selection zooming and panning - and selection zooming is active by default.
Its confusing my users. Especially this scenario: They zoom in using the mouse wheel, then want to pan but erroneously use selection (because it is active by default) and then they are zoomed to unwanted position and it is hard for them to return back.
Would it be possible to have panning active by default? Or use right mouse button for selection zooming and left button for panning for example?
Thanks!
Hi Ondrej Svoboda,
We have validated your query and would like to inform you that the default value of the EnableSelectionZooming property is False. Selection zooming is enabled only when this property is explicitly set to True. Therefore, the behavior you observed occurs only when Selection Zooming has been enabled in the application, as mouse wheel zooming and panning interactions are affected by the active zooming mode.
Could you please confirm whether your requirement is to use both Panning and Selection Zooming simultaneously in the chart?
In Syncfusion WPF Charts, both Selection Zooming and Panning use the left mouse button click-and-drag interaction, which is the default behavior of the chart's zooming and panning functionality. Currently, there is no built-in support to assign different mouse buttons for these interactions.
If you need to use both Selection Zooming and Panning, we recommend providing a toggle button or a similar UI option in your application to allow users to switch between the two modes as needed. This approach helps avoid accidental zoom operations and provides a clearer user experience.
Please try this approach and let us know if you need any further assistance.
Regards,
Baranibharathi P.
The toggle button is already there - I use your ZoomingToolbar (EnableZoomingToolBar = True) where user can perfectly switch between panning and selection zooming. My problem is that selection zooming mode (red on image below) is active by default - I would need pannig mode (blue) to be active by default. Is it possible?
Hi Ondrej Svoboda,
Thank you for providing the detailed information.
We have validated your requirement and would like to inform you that you can disable the selection zooming behavior by default by setting the EnableSelectionZooming property to false. Then, you can enable it when the user right-clicks the chart by handling the MouseDown event.
|
C# private void SfChart_MouseDown(object sender, MouseButtonEventArgs e) { if(e.RightButton == MouseButtonState.Pressed) { zooming.EnableSelectionZooming = true; } }
Xaml <syncfusion:SfChart MouseDown="SfChart_MouseDown"> |
For your convenience, we have attached a sample and a demo demonstrating this approach.
Please review the shared solution and let us know if you need any further assistance.
Regards,
Baranibharathi P.
Attachment: F198482_546d919e.zip
Hello,
this is not exactly what I wanted. Isn't it possible to set if panning or selection box is active? Not enabled, but active. I can switch between them in the toolbar manually - I would just need to do the same programmatically.
Regards
Ondřej
Hi Ondrej Svoboda,
We would like to clarify that chart panning becomes available only after a zooming action has been performed on the chart, either through mouse-wheel zooming or selection zooming. Therefore, when the chart is initially loaded with both Selection Zooming and Panning enabled, only the Selection Zooming toolbar icon is active by default.
After performing a zoom operation, you can manually switch the toolbar mode to Panning and navigate through the zoomed chart area. This is the default behavior of the chart's zooming and panning functionality.
If required to customize this behavior, we suggest using a chart annotation along with the MouseDown event to implement the desired interaction. Additionally, the toolbar can be customized using the ToolBaritems property of the ChartZoomPanBehavior.
We have provided a sample and a demo application that demonstrate this approach for your reference.
Please review them and let us know if you require any further assistance.
Best regards,
Baranibharathi P.
Attachment: F198482_363c727d.zip
- 5 Replies
- 2 Participants
-
OS Ondrej Svoboda
- Jul 9, 2026 01:58 PM UTC
- Jul 14, 2026 09:46 AM UTC