I found it unexpected that ChartPanel.setRangeZoomable(false)
does not affect mouse-wheel zooming. I dont' see any obvious
design motivation for that, so I suppose it's just an oversight.
The fix seems simple: MouseWheelHandler in handleZoomable
should check Chartpanel.isRangeZoomable before calling
zoomRangeAxes (and analogously for the domain axes).
The original code was:
Code: Select all
if (direction > 0) {
zoomable.zoomDomainAxes(increment, pinfo, p, true);
zoomable.zoomRangeAxes(increment, pinfo, p, true);
} else if (direction < 0) {
zoomable.zoomDomainAxes(1.0 / increment, pinfo, p, true);
zoomable.zoomRangeAxes(1.0 / increment, pinfo, p, true);
}
Code: Select all
if (direction < 0)
increment = 1.0 / increment;
if (chartPanel.isRangeZoomable())
zoomable.zoomRangeAxes(increment, pinfo, p, true);
if (chartPanel.isDomainZoomable())
zoomable.zoomDomainAxes(increment, pinfo, p, true);
To patch 1.0.13, I subclassed MouseWheelHandler to fix the
original bug, then subclassed ChartPanel to use my class
instead of the usual one, then fixed my own code to cons
up my own class of ChartPanel. Eccch. YMMV.
/jim