I have a problem in setting the Range.
I use the setRange() set the range,yes,It's right
but if I use the mouse to zoom in the chart, and then zoom out, the range changed, become different from the range which I set in the begining.
Do you know how to solve this problem??
A problem in setting Range
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
This is the way it works right now - zooming out just increases the axis ranges by a fixed factor, it doesn't restore some preset range. The latter behaviour would be a good feature to add to JFreeChart.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


David,
This was discussed a long time ago in the following thread.
jfree.org/phpBB2/viewtopic.php?t=13595
You had entered a bug report then. I actually want to contribute to the project implementing this feature.
I started out by adding two new properties to the ChartPanel (zoomResetDomainBounds(Range) and zoomResetRangeBounds(Range) with setters and getters). If these parameters are set, the program would not use autoBounds resetting, as you suggested.
However there seems to be no way to zoom out to a specifc range through the Zoomable interface.
Using instanceof and casting to XYPlot and CategoryPlot and then setting the domain and range manually through get[Domain|Range]Axis() seems like a hack.
Ideally this should be done through the Zoomable interface, I just can't quite figure out how.
If you have any suggestions, please let me know.
This was discussed a long time ago in the following thread.
jfree.org/phpBB2/viewtopic.php?t=13595
You had entered a bug report then. I actually want to contribute to the project implementing this feature.
I started out by adding two new properties to the ChartPanel (zoomResetDomainBounds(Range) and zoomResetRangeBounds(Range) with setters and getters). If these parameters are set, the program would not use autoBounds resetting, as you suggested.
However there seems to be no way to zoom out to a specifc range through the Zoomable interface.
Using instanceof and casting to XYPlot and CategoryPlot and then setting the domain and range manually through get[Domain|Range]Axis() seems like a hack.
Ideally this should be done through the Zoomable interface, I just can't quite figure out how.
If you have any suggestions, please let me know.
-
- Posts: 9
- Joined: Thu May 08, 2008 3:18 pm