Strange behavior of zoom in CombinedDomainXYPlot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Harry Plotter ;-)
Posts: 12
Joined: Thu Aug 04, 2005 2:56 pm
Location: Oldenburg - Germany

Strange behavior of zoom in CombinedDomainXYPlot

Post by Harry Plotter ;-) » Mon Sep 12, 2005 4:25 pm

Hello everybody,

I use two Charts in a CombinedDomainXYPlot. When I start zooming at one chart, the other zooms as well, thats fine.

But when I zoom in in one chart and zoom out on the other, one of the charts does not get properly zoomed out.
After a zoom out-move in this chart, both charts look fine again.

Has anybody encountered the same problem?

Regards,
Peter

Guest

Post by Guest » Tue Sep 13, 2005 9:17 am

you can test this behavior with the code provided in this Thread: http://www.jfree.org/phpBB2/viewtopic.p ... yplot+zoom

Harry Plotter ;-)
Posts: 12
Joined: Thu Aug 04, 2005 2:56 pm
Location: Oldenburg - Germany

Post by Harry Plotter ;-) » Tue Sep 13, 2005 9:18 am

The problem seems to be that the RangeAxis is not zoomed Out properly in the charts.

Here are some screenshots where you can see this:

Image
This is the Demo app, from the Thread mentioned above. No zoom-Action is done.

Image
Now I zoomed in at the top Chart. The bottom chart is zoomed, too. Everythin is fine.

Image
Now I zoom into the chart at the bottom. The chart at the top gets zoomed too. Also ok.

Image
At last, I zoom out at the bottom chart. Now the Chart at the top should be zoomed out, too. But as you can see, only the domainAxis gets zoomed out, but not the RangeAxis at the Chart at the top.

Does anybody know how to fix this or is this perhaps a bug?

Jan
Posts: 4
Joined: Tue Sep 13, 2005 12:22 pm

Post by Jan » Tue Sep 13, 2005 12:24 pm

Hello Harry,

we have a very similar problem in and would also be very much interested in a fix / solution. Any suggestions where to fix this?

Cheers, Jan

Jan
Posts: 4
Joined: Tue Sep 13, 2005 12:22 pm

Post by Jan » Tue Sep 13, 2005 12:49 pm

as a remark: we experience this behaviour with both jdk 1.4 and 1.5 and the latest jfreechart release.

Guest

Post by Guest » Tue Sep 13, 2005 3:00 pm

in CombinedDomainXYPlot I overrid the Method zoomRangeAxes:

Code: Select all

    public void zoomRangeAxes(double lowerPercent, double upperPercent, 
                              PlotRenderingInfo info, Point2D source) {
        //XYPlot subplot = findSubplot(info, source);
    	System.out.println("zoom out");
    	for(int i = 0;i<subplots.size();i++){
	        if (subplots.get(i) != null) {
	            ((XYPlot)subplots.get(i)).zoom(0.0);//.zoomRangeAxes(lowerPercent, upperPercent, info, source);
	        }
    	}
    }
I just wanted to test whether this method is called when the zoom-out is triggered.
Then I noticed that this change fixed my problem, although this method is not called when the zoom-out is triggered.

Does anybody know why this works? :D

Can anybody perhaps tell me a more "cleaner" solution?

Greetings,
Peter

Jan
Posts: 4
Joined: Tue Sep 13, 2005 12:22 pm

Post by Jan » Tue Sep 13, 2005 4:19 pm

interestting behaviour, we would be very interested to see this fixed without having to change sources locally. is there a commiter who could fix this? would be great!

Guest

Post by Guest » Fri Sep 30, 2005 9:35 am

...unfortunately the zoom at the y-Axis does not work with this fix.

So, does anybody have a clean fix for this problem?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Nov 03, 2005 5:15 pm

This thread has been linked in a bug report here:

https://sourceforge.net/tracker/index.p ... tid=115494

Please add any further information to this bug report.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

truthsense
Posts: 21
Joined: Thu Sep 29, 2005 4:11 pm

Post by truthsense » Fri Nov 04, 2005 5:37 pm

Is there any way to lock the zooming of this kind of plot to autoscale? Basically, to not allow drag and drop zooming? I can turn off the zooming option on the mouse pop-up menu, but can I just turn off all zoom capabilities on a plot?

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Fri Nov 04, 2005 10:59 pm

Try

Code: Select all

public void setMouseZoomable(boolean flag)
in ChartPanel.

Locked