Code: Select all
(function(H) {
const defined = H.defined;
let totalWheelDelta = 0,
totalWheelDeltaTimer;
H.Pointer.prototype.onContainerMouseWheel = function(e) {
const chart = this.chart;
e = this.normalize(e);
const delta = (defined(e.wheelDelta) && -(e.wheelDelta) / 120) || e.deltaY || e.detail;
if (Math.abs(delta) >= 1) {
totalWheelDelta += Math.abs(delta);
if (totalWheelDeltaTimer) {
clearTimeout(totalWheelDeltaTimer);
}
totalWheelDeltaTimer = setTimeout(() => {
totalWheelDelta = 0;
}, 50);
}
if (totalWheelDelta < 10 && chart.isInsidePlot(
e.chartX - chart.plotLeft,
e.chartY - chart.plotTop
)) {
chart.mapZoom(
Math.pow(
(chart.options.mapNavigation).mouseWheelSensitivity,
delta
),
chart.xAxis[0].toValue(e.chartX),
chart.yAxis[0].toValue(e.chartY),
e.chartX,
e.chartY,
Math.abs(delta) < 1 ? false : void 0
);
}
}
}(Highcharts))