Strange behavior of zoom in CombinedDomainXYPlot
-
- Posts: 12
- Joined: Thu Aug 04, 2005 2:56 pm
- Location: Oldenburg - Germany
Strange behavior of zoom in CombinedDomainXYPlot
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
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
you can test this behavior with the code provided in this Thread: http://www.jfree.org/phpBB2/viewtopic.p ... yplot+zoom
-
- Posts: 12
- Joined: Thu Aug 04, 2005 2:56 pm
- Location: Oldenburg - Germany
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:

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

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

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

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?
Here are some screenshots where you can see this:

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

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

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

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?
in CombinedDomainXYPlot I overrid the Method zoomRangeAxes:
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?
Can anybody perhaps tell me a more "cleaner" solution?
Greetings,
Peter
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);
}
}
}
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?

Can anybody perhaps tell me a more "cleaner" solution?
Greetings,
Peter
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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.
https://sourceforge.net/tracker/index.p ... tid=115494
Please add any further information to this bug report.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 21
- Joined: Thu Sep 29, 2005 4:11 pm
Try
in ChartPanel.
Code: Select all
public void setMouseZoomable(boolean flag)