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
With the latest chart.js v2.9.0 the scale.getValueForPixel method has been changed and its use in chartjs-plugin-zoom (tested with v0.7.4) causes misbehavior of pan with numerical scales and possibly others. Specifically, panning causes the chart to zoom. Exactly one of either the start or end of the scale remains fixed while the other stretches outwards.
The panNumericalScale function in chartjs-plugin-zoom uses scale.getValueForPixel to get the new minimum and maximum values for the scale (see
With the latest chart.js v2.9.0 the
scale.getValueForPixel
method has been changed and its use in chartjs-plugin-zoom (tested with v0.7.4) causes misbehavior of pan with numerical scales and possibly others. Specifically, panning causes the chart to zoom. Exactly one of either the start or end of the scale remains fixed while the other stretches outwards.The
panNumericalScale
function in chartjs-plugin-zoom usesscale.getValueForPixel
to get the new minimum and maximum values for the scale (seechartjs-plugin-zoom/src/plugin.js
Line 257 in 1cf272f
I believe the changes that are causing this issue were made in this commit of chart.js: chartjs/Chart.js@cbace1c#diff-f0d8f86fecab28f396793911b0e9f36dR746.
A demonstration of the bug can be found here: https://codepen.io/exwm/pen/vYYZREw. Simply pan the chart by dragging with the mouse.
The text was updated successfully, but these errors were encountered: