A problem in setting Range

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
awayage
Posts: 1
Joined: Sat Mar 17, 2007 2:06 pm

A problem in setting Range

Post by awayage » Sat Mar 17, 2007 2:19 pm

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??

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 » Mon Mar 19, 2007 6:20 pm

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

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

ye238
Posts: 1
Joined: Mon Apr 16, 2007 2:59 pm

Post by ye238 » Mon Apr 16, 2007 3:18 pm

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.

tatia34
Posts: 23
Joined: Fri Apr 27, 2007 2:11 pm
Location: France

Post by tatia34 » Mon Sep 17, 2007 2:37 pm

Hi, is this feature know implemented ?
or how can we do to resolve this problem ?

thanks, tatia34

Alphonse87
Posts: 9
Joined: Thu May 08, 2008 3:18 pm

Post by Alphonse87 » Fri Jun 06, 2008 11:06 am

Hello everyone,

I have the same issue, and i don't find any solution.

Does somebody find a way to resovle this ?

nubiste
Posts: 13
Joined: Mon Aug 04, 2008 9:53 am

Post by nubiste » Tue Aug 26, 2008 9:58 am

Any suggestions how to implement this? I read in the other post
Have a look at autoRangeBoth() in ChartPanel
Couldn't find that anywhere.
Any ideas of the logic to do this?

thanks

Locked