version 2022.1.119
My chart is freezing due to an infinite loop in DateCategoryAxis.scaleRange upon scrolling the mouse wheel over the chart (in an attempt to just scroll the page itself).
I have Zoomable(false) and Pannable(false).
The while condition highlighted below is never false when "delta" is not a positive integer (>= 1) or zero.
In my case, the function was passed delta = 0.3, so the loop iterates 0.3, -0.7, -1.7, -2.7, etc.
scaleRange: function (delta) {
var rounds = Math.abs(delta);
var result = this.range();
var from = result.min;
var to = result.max;
if (from && to) {
while (rounds--) {
var range = dateDiff(from, to);
var step = Math.round(range * 0.1);
if (delta < 0) {
from = addTicks(from, step);
to = addTicks(to, -step);
} else {
from = addTicks(from, -step);
to = addTicks(to, step);
}
}
result = {
min: from,
max: to
};
}
return result;
},
It looks like there are other definitions of scaleRange() that are using the same code that probably would also need fixing.
EDIT: it appears that the reason "delta" is being passed in as 0.3 is because in the handler Chart._mousewheel:
totalDelta = -1
this$1._mousewheelZoomRate() == 0.3
therefore: -totalDelta * this$1._mousewheelZoomRate() == 0.3
I haven't dug into the code enough to know whether or not this is an issue, or is expected.
Hi Greg,
Can you share the configuration of the Chart so I can try and reproduce the issue. I have tested in this REPL, but have failed in reproducing the issue.