Great great graphing software, I have been doing a lot of playing with it over the past week.
Anyways I found this problem when trying to zoom in with the mouse on a XYPlot graph it only includes the zoomArea within the bounding box but not the box itself. So if you try to zoom in at the starting point on the domain axis it is not possible. This seems to only apply to the domain axis.
For example try to zoom into (0,0) on the XYSeriesDemo1 graph.
this is my HACK fix
Code: Select all
ChartPanel chart = new ChartPanel(null) {
public void zoom(Rectangle2D selection) {
Rectangle2D screenDataArea = getScreenDataArea(
(int) selection.getX(),
(int) selection.getY());
// expand the zoom frame by one pixel
selection.setFrame(
selection.getX()-1,
selection.getY()-1,
selection.getWidth()+2,
selection.getHeight()+2);
double x = Math.max(screenDataArea.getMinX(), selection.getMinX());
double y = Math.max(screenDataArea.getMinY(), selection.getMinY());
double w = Math.min(screenDataArea.getWidth(), selection.getWidth());
double h = Math.min(screenDataArea.getHeight(), selection.getHeight());
selection.setFrame(x,y,w,h);
super.zoom(selection);
};