Bringing a plot to its original state

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
avanidhar
Posts: 16
Joined: Wed Jun 11, 2008 10:47 pm

Bringing a plot to its original state

Post by avanidhar » Mon Feb 09, 2009 6:21 pm

Hello All,

I used a custom piece of code to change the domain and range axis of a plot to implement custom zooming and panning. Now, when i try to reset the domain and range axes to their initial values, I am unable to do that. Is there any library function which does this? Do let me know.

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

Post by skunk » Mon Feb 09, 2009 8:03 pm

If, by "initial values" you mean the entire plot, then you can call this method on each zoomed axis

Code: Select all

public void setAutoRange(boolean auto)
On the other hand, if by "initial values" you mean the axis state before the most recent zoom then you will need to add some code to save the previous range of each axis immediately before the calls to setRange(...)

avanidhar
Posts: 16
Joined: Wed Jun 11, 2008 10:47 pm

Post by avanidhar » Tue Feb 10, 2009 5:54 pm

Thanks a ton :) That is exactly what i needed.

avanidhar
Posts: 16
Joined: Wed Jun 11, 2008 10:47 pm

Post by avanidhar » Tue Feb 10, 2009 7:27 pm

Thanks a ton :) That is exactly what i needed.

Locked