XYPlot zoom at domain bug

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bryce
Posts: 2
Joined: Fri Jan 12, 2007 11:12 pm

XYPlot zoom at domain bug

Post by bryce » Fri Jan 12, 2007 11:25 pm

Hey,

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);
            };

akbabav
Posts: 1
Joined: Wed Mar 19, 2008 1:19 pm

Post by akbabav » Wed Mar 19, 2008 1:21 pm

could you find any solution for this.
I have same problem.

Locked