|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.chart.axis.Axis | +--org.jfree.chart.axis.ValueAxis | +--org.jfree.chart.axis.NumberAxis
The base class for axes that display numerical data.
If the axis is set up to automatically determine its range to fit the data,
you can ensure that the range includes zero (statisticians usually prefer
this) by setting the autoRangeIncludesZero
flag to true
.
The NumberAxis
class has a mechanism for automatically selecting a tick unit
that is appropriate for the current axis range. This mechanism is an
adaptation of code suggested by Laurence Vanhelsuwe.
Field Summary | |
static boolean |
DEFAULT_AUTO_RANGE_INCLUDES_ZERO
The default value for the autoRangeIncludesZero flag. |
static boolean |
DEFAULT_AUTO_RANGE_STICKY_ZERO
The default value for the autoRangeStickyZero flag. |
static NumberTickUnit |
DEFAULT_TICK_UNIT
The default tick unit. |
Fields inherited from class org.jfree.chart.axis.ValueAxis |
DEFAULT_AUTO_RANGE, DEFAULT_AUTO_RANGE_MINIMUM_SIZE, DEFAULT_AUTO_TICK_UNIT_SELECTION, DEFAULT_INVERTED, DEFAULT_LOWER_BOUND, DEFAULT_LOWER_MARGIN, DEFAULT_RANGE, DEFAULT_UPPER_BOUND, DEFAULT_UPPER_MARGIN, MAXIMUM_TICK_COUNT |
Constructor Summary | |
protected |
NumberAxis(java.lang.String label)
Constructs a number axis, using default values where necessary. |
Method Summary | |
boolean |
autoRangeIncludesZero()
Returns the flag that indicates whether or not the automatic axis range (if indeed it is determined automatically) is forced to include zero. |
boolean |
autoRangeStickyZero()
Returns a flag that affects the auto-range when zero falls outside the data range but inside the margins defined for the axis. |
double |
calculateHighestVisibleTickValue()
Calculates the value of the highest visible tick on the axis. |
double |
calculateLowestVisibleTickValue()
Calculates the value of the lowest visible tick on the axis. |
int |
calculateVisibleTickCount()
Calculates the number of visible ticks. |
static TickUnits |
createIntegerTickUnits()
Returns a collection of tick units for integer values. |
static TickUnits |
createIntegerTickUnits(java.util.Locale locale)
Returns a collection of tick units for integer values. |
static TickUnits |
createStandardTickUnits()
Creates the standard tick units. |
static TickUnits |
createStandardTickUnits(java.util.Locale locale)
Creates a collection of standard tick units. |
java.text.NumberFormat |
getNumberFormatOverride()
Returns the number format override. |
NumberTickUnit |
getTickUnit()
Returns the tick unit for the axis. |
void |
setAutoRangeIncludesZero(boolean flag)
Sets the flag that indicates whether or not the axis range, if automatically calculated, is forced to include zero. |
void |
setAutoRangeStickyZero(boolean flag)
Sets a flag that affects the auto-range when zero falls outside the data range but inside the margins defined for the axis. |
void |
setNumberFormatOverride(java.text.NumberFormat formatter)
Sets the number format override. |
void |
setTickUnit(NumberTickUnit unit)
Sets the tick unit for the axis. |
void |
setTickUnit(NumberTickUnit unit,
boolean notify,
boolean turnOffAutoSelect)
Sets the tick unit for the axis. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean DEFAULT_AUTO_RANGE_INCLUDES_ZERO
public static final boolean DEFAULT_AUTO_RANGE_STICKY_ZERO
public static final NumberTickUnit DEFAULT_TICK_UNIT
Constructor Detail |
protected NumberAxis(java.lang.String label)
label
- the axis label.Method Detail |
public boolean autoRangeIncludesZero()
public void setAutoRangeIncludesZero(boolean flag)
If the flag is changed to true
, the axis range is recalculated.
Any change to the flag will trigger an AxisChangeEvent
.
flag
- the new value of the flag.public boolean autoRangeStickyZero()
public void setAutoRangeStickyZero(boolean flag)
flag
- the new flag.public NumberTickUnit getTickUnit()
public void setTickUnit(NumberTickUnit unit)
AxisChangeEvent
to all registered
listeners.
unit
- the new tick unit.public void setTickUnit(NumberTickUnit unit, boolean notify, boolean turnOffAutoSelect)
AxisChangeEvent
to all
registered listeners.
unit
- the new tick unit.notify
- notify listeners?turnOffAutoSelect
- turn off the auto-tick selection?public java.text.NumberFormat getNumberFormatOverride()
public void setNumberFormatOverride(java.text.NumberFormat formatter)
formatter
- the number formatter (null permitted).public double calculateLowestVisibleTickValue()
public double calculateHighestVisibleTickValue()
public int calculateVisibleTickCount()
public static TickUnits createStandardTickUnits()
If you don't like these defaults, create your own instance of TickUnits and then pass it to the setStandardTickUnits(...) method in the NumberAxis class.
public static TickUnits createIntegerTickUnits()
public static TickUnits createStandardTickUnits(java.util.Locale locale)
NumberFormat
).
If you don't like these defaults, create your own instance of TickUnits
and then pass it to the setStandardTickUnits(...)
method.
locale
- the locale.
public static TickUnits createIntegerTickUnits(java.util.Locale locale)
locale
- the locale to use to represent Numbers.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |