diff --git a/README.md b/README.md index 2f33ec281..b8e522eef 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,9 @@ plugins: { // (percentage of zoom on a wheel event) speed: 0.1, + // Minimal zoom distance required before actually applying zoom + threshold: 2, + // On category scale, minimal zoom level before actually applying zoom sensitivity: 3, diff --git a/src/plugin.js b/src/plugin.js index 52227049b..56624da02 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -482,7 +482,8 @@ var zoomPlugin = { chartInstance.$zoom._dragZoomStart = null; chartInstance.$zoom._dragZoomEnd = null; - if (dragDistanceX <= 0 && dragDistanceY <= 0) { + var zoomThreshold = options.zoom && options.zoom.threshold || 0; + if (dragDistanceX <= zoomThreshold && dragDistanceY <= zoomThreshold) { return; }