Ok, I did this by overriding MouseWheelListener. After chartPannel.setMouseZoomable (false) .:
chartPanel.addMouseWheelListener(new MouseWheelListener() {
public void mouseWheelMoved(MouseWheelEvent arg0) {
if (arg0.getWheelRotation() > 0) {
chartPanel.zoomOutDomain(0.5, 0.5);
} else if (arg0.getWheelRotation() < 0) {
chartPanel.zoomInDomain(1.5, 1.5);
}
}
});
zoom (In / Out) Domain, because I wanted to rescale only the axis of the domain.
source
share