Disable Selection Zooming on right click

I am trying to add a context menu to a chart, while enabling Selection Zooming. I would like selection zooming to only work on left click. Is this possible?

I've tried listening to the context menu's OnOpen event, but this seems to be called after OnZoomEnd so I cannot cancel the zoom this way.


4 Replies 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team September 18, 2024 12:01 PM UTC

Hi Andrew,


We have ensured your reported scenario by adding context menu for chart control with selection zooming enabled. We were able to display context menu on right click and able to perform selection zooming on left click in chart. We have attached the sample for your reference.


<div id="target">

<SfChart></SfChart>

</div>

<SfContextMenu Target="#target" TValue="MenuItem"></SfContextMenu>



Sample : https://blazorplayground.syncfusion.com/VXrJNuClqzoKLwgY


If you are still facing problem, please try to replicate an issue in above sample or share us issue replicating video or steps to reproduce an issue, so that it will be helpful to validate this case further and assist you better.


Regards,

Durga Gopalakrishnan.



AJ Andrew Jank September 18, 2024 12:53 PM UTC

In your sample, the chart still zooms on a right click when dragging. I would like to disable this behavior for right click only. I have often accidentally right clicked and slightly dragged my mouse to display the context menu and end up zooming in. 



DG Durga Gopalakrishnan Syncfusion Team September 19, 2024 11:22 AM UTC

Andrew,


We have considered your reported scenario as bug and logged a defect report for the issue ”Chart selection zooming is performed on right click and dragging”. This fix will be available in our weekly patch release which is scheduled to be rolled out on 30th September 2024. We appreciate your patience until then. You can keep track of the bug from the below feedback link.


Feedback : https://www.syncfusion.com/feedback/61430/chart-selection-zooming-is-performed-on-right-click-and-dragging


If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”


Marked as answer

DG Durga Gopalakrishnan Syncfusion Team October 8, 2024 01:52 PM UTC

Andrew,


We are glad to announce that our v27.1.52 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor.Charts NuGet package.


Root Cause:

When we click the right mouse button, the chart's MouseDown event is triggered, executing its functions.


Fix:

Provided appropriate condition to prevent the MouseDown function from executing for a right or center mouse click.


NuGet Package : https://www.nuget.org/packages/Syncfusion.Blazor.Charts/


Sample : https://blazorplayground.syncfusion.com/BXLziXNPzkcpJQOt


Feedback : https://www.syncfusion.com/feedback/61430/chart-selection-zooming-is-performed-on-right-click-and-dragging


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Loader.
Up arrow icon