I need to add the mouse wheel in the highcharts vertical scrollbar. I got the code in this fiddle http://jsfiddle.net/d3r8pb7c/ but that code written in jQuery format. When i try to add the code in the typescript in the following way mouse wheel not working.
this.options = {
chart: {
events: {
wheel: function (event) {
var delta, extr, step, newMin, newMax, axis = this.xAxis[0];
var dataMax = this.xAxis[0].dataMax,
dataMin = this.xAxis[0].dataMin,
newExtrMin,
newExtrMax;
e = this.pointer.normalize(event);
delta = e.detail || -(e.deltaY / 120);
delta = delta < 0 ? 1 : -1;
if (this.isInsidePlot(e.chartX - this.plotLeft, e.chartY - this.plotTop)) {
extr = axis.getExtremes();
step = (extr.max - extr.min) / 5 * delta;
if ((extr.min + step) <= dataMin) {
newExtrMin = dataMin;
newExtrMax = extr.max;
} else if ((extr.max + step) >= dataMax) {
newExtrMin = extr.min;
newExtrMax = dataMax;
} else {
newExtrMin = extr.min + step;
newExtrMax = extr.max + step;
}
axis.setExtremes(newExtrMin, newExtrMax, true, false);
}
stopEvent(event); // Issue #5011, returning false from non-jQuery event does not prevent default
return false;
},
}
},
Please help me if anyone add the mouse wheel event in the Highcharts angular2 typescript.