You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using chart.js@3.6.2 and chartjs-plugin-zoom@1.2.0.
I found that it is possible to zoom outside of chart data region.
For example, I can zoom on legend / y-axis even if there is no data in this region.
Hi,
I am using
chart.js@3.6.2
andchartjs-plugin-zoom@1.2.0
.I found that it is possible to zoom outside of chart data region.
For example, I can zoom on legend / y-axis even if there is no data in this region.
See bellow screen capture:
I have following zoom plugin configuration:
I can provide
limits
configuration, which helps.But it is still possible to highlight legend / y-axis and trigger zoom with unwanted data.
I did not find any related issue on this git repository or on stackoverflow.com.
Is there any way to prevent zooming outside of data region ?
EDIT:
Looking deeper at the library code, I may have found the root cause of this "bug".
In
chartjs-plugin-zoom/src/handlers.js
Lines 67 to 83 in bb6dee3
Variables,
left
/right
/top
/bottom
are overridden ifxEnabled
or / andyEnabled
.Code should be:
Changing above lines fix the issue on local workspace. But I do not know if there is other impact changing this.
I can provide PR if anyone wants 😄
The text was updated successfully, but these errors were encountered: