Feature #1193

Updated by Sebastien Jacquot over 5 years ago

Improve the scale and pan behavior in JFC charts engine.

h3. Solution 1

A simple way to keep axis stuck near the chart even if it's reduced is to play with the TickLabelInset while zooming/scaling. It may needs to extend the ChartPanel class and/or modify the JFC class MouseWheelHandler.
Eg. for changing the bottom label inset, should be called when scaling (and panning ?):
plot.getDomainAxis().setTickLabelInsets(new RectangleInsets(0, 0, 100, 0));

Other (better ?) way could be to redefine the behavior of XYPlot.zoomDomainAxes() or resizeRange() method of Axis.

h3. Solution 2

When zooming out and the chart becomes smaller than the ChartPanel dimensions, switch to an "Image zoom" mode meaning that the axes ticks unit ticks do not update themselves anymore and all entities are reduced (even label texts, titles, legends, etc.) as a raster image scaling.
When zooming in and the chart becomes bigger than the ChartPanel dimensions, restore the original JFC behavior.