Perhaps I'm missing something obvious, but I'm unable to call the autoAdjustRange() method in NumberAxis due to it having protected access. How might I perform this operation? If I had something like a LogarithmicAxis object I could do it, but not so with a plain old NumberAxis.
Any suggestions are greatly appreciated.
Calling autoAdjustRange() in NumberAxis
-
- Posts: 844
- Joined: Fri Oct 13, 2006 9:29 pm
- Location: Sunnyvale, CA
autoAdjustRange has protected access since it is a method used as part of the drawing process and is not intended to be used otherwise. What are you trying to accomplish? Most likely, there is a means to do what you want with the public methods.
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
I have a line graph which has a y minimum of about 200 and a maximum of about 250. Unfortunately, as the NumberAxis I'm using for the range starts at zero, this leaves a lot of empty space below the line. When I created the NumberAxis I tried calling the setAutoRangeIncludesZero() method which I hoped would solve the problem, but it doesn't appear to have made any difference (my dataset includes many null values, so these are perhaps the culprit here). I thought that calling autoAdjustRange() after I add the dataset to the plot might do the trick, but as you say this method isn't meant to be used directly.
Surely there's a simple way to accomplish what I wish to do. Has anybody else run into a similar problem and found a solution?
Surely there's a simple way to accomplish what I wish to do. Has anybody else run into a similar problem and found a solution?
Code: Select all
public void setAutoRangeIncludesZero(boolean flag)
Disregard this, I found the reason why calling the setAutoRangeIncludesZero() method didn't work. Deep in my code I set the plot to use a new NumberAxis which hadn't been set to not include zero. Now it works as it should. Thanks for the help.mminer wrote:When I created the NumberAxis I tried calling the setAutoRangeIncludesZero() method which I hoped would solve the problem, but it doesn't appear to have made any difference