chartjs / chartjs-plugin-zoom

Zoom and pan plugin for Chart.js
MIT License
595 stars 325 forks source link

Disable auto zoom-out after toggling datasets, when clicking on the legend. #817

Open VandreiVer opened 6 months ago

VandreiVer commented 6 months ago

Take the most basic line chart with the zoom plugin and 2 datasets.

  1. Zoom in on the chart with both datasets visible.
  2. Click on the legend to hide one of the datasets.

Expectations: The chart zoom level remains the same so that I don't have to zoom in again to whichever data point I was interested in.

Actual result: The chart is updated and the zoom level is back to the default one.

Findings: Trying to hook into the onZoomStart and cancel the zoom did not work. The event was not the one being triggered.

baobaoejiahao commented 1 week ago

I am having the same issue. Can someone come help?

baobaoejiahao commented 1 week ago

I have faced the smiliar issue that I have created a customized contextmenu by double click. When I double click, the chart automatically zooms out....