java.lang.Object | ||
↳ | org.jfree.chart.axis.Axis | |
↳ | org.jfree.chart.axis.ValueAxis |
![]() |
![]() |
The base class for axes that display value data, where values are measured
using the double
primitive. The two key subclasses are
DateAxis
and NumberAxis
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | DEFAULT_AUTO_RANGE | The default auto-range value. | |||||||||
double | DEFAULT_AUTO_RANGE_MINIMUM_SIZE | The default minimum auto range. | |||||||||
boolean | DEFAULT_AUTO_TICK_UNIT_SELECTION | The default auto-tick-unit-selection value. | |||||||||
boolean | DEFAULT_INVERTED | The default inverted flag setting. | |||||||||
double | DEFAULT_LOWER_BOUND |
This constant is deprecated.
From 1.0.5 onwards, the axis defines a defaultRange
attribute (see getDefaultAutoRange() ).
|
|||||||||
double | DEFAULT_LOWER_MARGIN | The default value for the lower margin (0.05 = 5%). | |||||||||
double | DEFAULT_UPPER_BOUND |
This constant is deprecated.
From 1.0.5 onwards, the axis defines a defaultRange
attribute (see getDefaultAutoRange() ).
|
|||||||||
double | DEFAULT_UPPER_MARGIN | The default value for the upper margin (0.05 = 5%). | |||||||||
int | MAXIMUM_TICK_COUNT | The maximum tick count. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_RANGE | The default axis range. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a value axis.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Centers the axis range about the specified value and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Returns a clone of the object.
| |||||||||||
Tests the axis for equality with an arbitrary object.
| |||||||||||
Returns the minimum size allowed for the axis range when it is
automatically calculated.
| |||||||||||
Returns the default auto range.
| |||||||||||
Returns a shape that can be displayed as an arrow pointing downwards at
the end of an axis line.
| |||||||||||
Returns the fixed auto range.
| |||||||||||
Returns a shape that can be displayed as an arrow pointing left at the
end of an axis line.
| |||||||||||
Returns the lower bound of the axis range.
| |||||||||||
Returns the lower margin for the axis, expressed as a percentage of the
axis range.
| |||||||||||
Returns the number of minor tick marks to display.
| |||||||||||
Returns the range for the axis.
| |||||||||||
Returns a shape that can be displayed as an arrow pointing right at the
end of an axis line.
| |||||||||||
Returns the source for obtaining standard tick units for the axis.
| |||||||||||
Returns a shape that can be displayed as an arrow pointing upwards at
the end of an axis line.
| |||||||||||
Returns the upper bound for the axis range.
| |||||||||||
Returns the upper margin for the axis, expressed as a percentage of the
axis range.
| |||||||||||
Returns the flag that controls whether or not the axis range is
automatically adjusted to fit the data values.
| |||||||||||
Returns a flag indicating whether or not the tick unit is automatically
selected from a range of standard tick units.
| |||||||||||
Returns a flag that controls the direction of values on the axis.
| |||||||||||
Returns a flag that controls whether or not the axis line has an arrow
drawn that points in the negative direction for the axis.
| |||||||||||
Returns a flag that controls whether or not the axis line has an arrow
drawn that points in the positive direction for the axis.
| |||||||||||
Returns
true if the tick labels should be rotated (to
vertical), and false otherwise. | |||||||||||
Converts a coordinate in Java2D space to the corresponding data value,
assuming that the axis runs along one edge of the specified dataArea.
| |||||||||||
Converts a length in data coordinates into the corresponding length in
Java2D coordinates.
| |||||||||||
Slides the axis range by the specified percentage.
| |||||||||||
Returns the space required to draw the axis.
| |||||||||||
Increases or decreases the axis range by the specified percentage about
the central value and sends an
AxisChangeEvent to all registered
listeners. | |||||||||||
Increases or decreases the axis range by the specified percentage about
the specified anchor value and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Increases or decreases the axis range by the specified percentage about
the specified anchor value and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets a flag that determines whether or not the axis range is
automatically adjusted to fit the data, and notifies registered
listeners that the axis has been modified.
| |||||||||||
Sets the auto range minimum size and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Sets the minimum size allowed for the axis range when it is
automatically calculated.
| |||||||||||
Sets a flag indicating whether or not the tick unit is automatically
selected from a range of standard tick units.
| |||||||||||
Sets a flag indicating whether or not the tick unit is automatically
selected from a range of standard tick units.
| |||||||||||
Sets the default auto range and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the shape that can be displayed as an arrow pointing downwards at
the end of an axis line and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the fixed auto range for the axis.
| |||||||||||
Sets a flag that controls the direction of values on the axis, and
notifies registered listeners that the axis has changed.
| |||||||||||
Sets the shape that can be displayed as an arrow pointing left at the
end of an axis line and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the lower bound for the axis range.
| |||||||||||
Sets the lower margin for the axis (as a percentage of the axis range)
and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the number of minor tick marks to display, and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets a flag that controls whether or not the axis lines has an arrow
drawn that points in the negative direction for the axis, and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets a flag that controls whether or not the axis lines has an arrow
drawn that points in the positive direction for the axis, and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the range for the axis, if requested, sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the axis range and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the range attribute and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the axis range, where the new range is 'size' in length, and
centered on 'value'.
| |||||||||||
Sets the range for the axis (after first adding the current margins to
the specified range) and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the axis range (after first adding the current margins to the
range) and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the range for the axis after first adding the current margins to
the range and, if requested, sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the shape that can be displayed as an arrow pointing rightwards at
the end of an axis line and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the source for obtaining standard tick units for the axis and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the shape that can be displayed as an arrow pointing upwards at
the end of an axis line and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the upper bound for the axis range, and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the upper margin for the axis (as a percentage of the axis range)
and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the flag that controls whether the tick labels are displayed
vertically (that is, rotated 90 degrees from horizontal).
| |||||||||||
Converts a data value to a coordinate in Java2D space, assuming that the
axis runs along one edge of the specified dataArea.
| |||||||||||
Zooms in on the current range.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Automatically sets the axis range to fit the range of values in the
dataset.
| |||||||||||
Calculates the anchor point for a tick label.
| |||||||||||
Draws an axis line at the current cursor position and edge.
| |||||||||||
Draws the axis line, tick marks and tick mark labels.
| |||||||||||
A utility method for determining the height of the tallest tick label.
| |||||||||||
A utility method for determining the width of the widest tick label.
| |||||||||||
Returns the auto tick index.
| |||||||||||
Sets the auto range attribute.
| |||||||||||
Sets the auto tick index.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
The default auto-range value.
The default minimum auto range.
The default auto-tick-unit-selection value.
The default inverted flag setting.
This constant is deprecated.
From 1.0.5 onwards, the axis defines a defaultRange
attribute (see getDefaultAutoRange()
).
The default lower bound for the axis.
The default value for the lower margin (0.05 = 5%).
This constant is deprecated.
From 1.0.5 onwards, the axis defines a defaultRange
attribute (see getDefaultAutoRange()
).
The default upper bound for the axis.
The default value for the upper margin (0.05 = 5%).
The maximum tick count.
Constructs a value axis.
label | the axis label (null permitted). |
---|---|
standardTickUnits | the source for standard tick units
(null permitted).
|
Centers the axis range about the specified value and sends an
AxisChangeEvent
to all registered listeners.
value | the center value. |
---|
Returns a clone of the object.
CloneNotSupportedException | if some component of the axis does not support cloning. |
---|
Tests the axis for equality with an arbitrary object.
obj | the object (null permitted). |
---|
true
or false
.
Returns the minimum size allowed for the axis range when it is automatically calculated.
Returns the default auto range.
null
).Returns a shape that can be displayed as an arrow pointing downwards at the end of an axis line.
null
).Returns a shape that can be displayed as an arrow pointing left at the end of an axis line.
null
).Returns the lower margin for the axis, expressed as a percentage of the axis range. This controls the space added to the lower end of the axis when the axis range is automatically calculated (it is ignored when the axis range is set explicitly). The default value is 0.05 (five percent).
Returns the number of minor tick marks to display.
Returns a shape that can be displayed as an arrow pointing right at the end of an axis line.
null
).Returns the source for obtaining standard tick units for the axis.
null
).Returns a shape that can be displayed as an arrow pointing upwards at the end of an axis line.
null
).Returns the upper margin for the axis, expressed as a percentage of the axis range. This controls the space added to the lower end of the axis when the axis range is automatically calculated (it is ignored when the axis range is set explicitly). The default value is 0.05 (five percent).
Returns the flag that controls whether or not the axis range is automatically adjusted to fit the data values.
Returns a flag indicating whether or not the tick unit is automatically selected from a range of standard tick units.
Returns a flag that controls the direction of values on the axis.
For a regular axis, values increase from left to right (for a horizontal axis) and bottom to top (for a vertical axis). When the axis is 'inverted', the values increase in the opposite direction.
Returns a flag that controls whether or not the axis line has an arrow drawn that points in the negative direction for the axis.
Returns a flag that controls whether or not the axis line has an arrow drawn that points in the positive direction for the axis.
Returns true
if the tick labels should be rotated (to
vertical), and false
otherwise.
true
or false
.Converts a coordinate in Java2D space to the corresponding data value, assuming that the axis runs along one edge of the specified dataArea.
java2DValue | the coordinate in Java2D space. |
---|---|
area | the area in which the data is plotted. |
edge | the edge along which the axis lies. |
Converts a length in data coordinates into the corresponding length in Java2D coordinates.
length | the length. |
---|---|
area | the plot area. |
edge | the edge along which the axis lies. |
Slides the axis range by the specified percentage.
percent | the percentage. |
---|
Returns the space required to draw the axis.
g2 | the graphics device. |
---|---|
plot | the plot that the axis belongs to. |
plotArea | the area within which the plot should be drawn. |
edge | the axis location. |
space | the space already reserved (for other axes). |
Increases or decreases the axis range by the specified percentage about
the central value and sends an AxisChangeEvent
to all registered
listeners.
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent | the resize factor. |
---|
Increases or decreases the axis range by the specified percentage about
the specified anchor value and sends an AxisChangeEvent
to all
registered listeners.
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent | the resize factor. |
---|---|
anchorValue | the new central value after the resize. |
Increases or decreases the axis range by the specified percentage about
the specified anchor value and sends an AxisChangeEvent
to all
registered listeners.
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent | the resize factor. |
---|---|
anchorValue | the new central value after the resize. |
Sets a flag that determines whether or not the axis range is automatically adjusted to fit the data, and notifies registered listeners that the axis has been modified.
auto | the new value of the flag. |
---|
Sets the auto range minimum size and sends an AxisChangeEvent
to all registered listeners.
size | the size. |
---|
Sets the minimum size allowed for the axis range when it is automatically calculated.
If requested, an AxisChangeEvent
is forwarded to all registered
listeners.
size | the new minimum. |
---|---|
notify | notify listeners? |
Sets a flag indicating whether or not the tick unit is automatically selected from a range of standard tick units.
flag | the new value of the flag. |
---|---|
notify | notify listeners? |
Sets a flag indicating whether or not the tick unit is automatically selected from a range of standard tick units. If the flag is changed, registered listeners are notified that the chart has changed.
flag | the new value of the flag. |
---|
Sets the default auto range and sends an AxisChangeEvent
to all
registered listeners.
range | the range (null not permitted). |
---|
Sets the shape that can be displayed as an arrow pointing downwards at
the end of an axis line and sends an AxisChangeEvent
to all
registered listeners.
arrow | the arrow shape (null not permitted). |
---|
Sets the fixed auto range for the axis.
length | the range length. |
---|
Sets a flag that controls the direction of values on the axis, and notifies registered listeners that the axis has changed.
flag | the flag. |
---|
Sets the shape that can be displayed as an arrow pointing left at the
end of an axis line and sends an AxisChangeEvent
to all
registered listeners.
arrow | the arrow shape (null not permitted). |
---|
Sets the lower bound for the axis range. An AxisChangeEvent
is
sent to all registered listeners.
min | the new minimum. |
---|
Sets the lower margin for the axis (as a percentage of the axis range)
and sends an AxisChangeEvent
to all registered listeners. This
margin is added only when the axis range is auto-calculated - if you set
the axis range manually, the margin is ignored.
margin | the margin percentage (for example, 0.05 is five percent). |
---|
Sets the number of minor tick marks to display, and sends an
AxisChangeEvent
to all registered listeners.
count | the count. |
---|
Sets a flag that controls whether or not the axis lines has an arrow
drawn that points in the negative direction for the axis, and sends an
AxisChangeEvent
to all registered listeners.
visible | the flag. |
---|
Sets a flag that controls whether or not the axis lines has an arrow
drawn that points in the positive direction for the axis, and sends an
AxisChangeEvent
to all registered listeners.
visible | the flag. |
---|
Sets the range for the axis, if requested, sends an
AxisChangeEvent
to all registered listeners. As a side-effect,
the auto-range flag is set to false
(optional).
range | the range (null not permitted). |
---|---|
turnOffAutoRange | a flag that controls whether or not the auto range is turned off. |
notify | a flag that controls whether or not listeners are notified. |
Sets the axis range and sends an AxisChangeEvent
to all
registered listeners. As a side-effect, the auto-range flag is set to
false
.
lower | the lower axis limit. |
---|---|
upper | the upper axis limit. |
Sets the range attribute and sends an AxisChangeEvent
to all
registered listeners. As a side-effect, the auto-range flag is set to
false
.
range | the range (null not permitted). |
---|
Sets the axis range, where the new range is 'size' in length, and centered on 'value'.
value | the central value. |
---|---|
length | the range length. |
Sets the range for the axis (after first adding the current margins to
the specified range) and sends an AxisChangeEvent
to all
registered listeners.
range | the range (null not permitted).
|
---|
Sets the axis range (after first adding the current margins to the
range) and sends an AxisChangeEvent
to all registered listeners.
As a side-effect, the auto-range flag is set to false
.
lower | the lower axis limit. |
---|---|
upper | the upper axis limit. |
Sets the range for the axis after first adding the current margins to
the range and, if requested, sends an AxisChangeEvent
to all
registered listeners. As a side-effect, the auto-range flag is set to
false
(optional).
range | the range (excluding margins, null not
permitted). |
---|---|
turnOffAutoRange | a flag that controls whether or not the auto range is turned off. |
notify | a flag that controls whether or not listeners are notified. |
Sets the shape that can be displayed as an arrow pointing rightwards at
the end of an axis line and sends an AxisChangeEvent
to all
registered listeners.
arrow | the arrow shape (null not permitted). |
---|
Sets the source for obtaining standard tick units for the axis and sends
an AxisChangeEvent
to all registered listeners. The axis will
try to select the smallest tick unit from the source that does not cause
the tick labels to overlap (see also the
setAutoTickUnitSelection(boolean)
method.
source | the source for standard tick units (null
permitted). |
---|
Sets the shape that can be displayed as an arrow pointing upwards at
the end of an axis line and sends an AxisChangeEvent
to all
registered listeners.
arrow | the arrow shape (null not permitted). |
---|
Sets the upper bound for the axis range, and sends an
AxisChangeEvent
to all registered listeners.
max | the new maximum. |
---|
Sets the upper margin for the axis (as a percentage of the axis range)
and sends an AxisChangeEvent
to all registered listeners. This
margin is added only when the axis range is auto-calculated - if you set
the axis range manually, the margin is ignored.
margin | the margin percentage (for example, 0.05 is five percent). |
---|
Sets the flag that controls whether the tick labels are displayed
vertically (that is, rotated 90 degrees from horizontal). If the flag
is changed, an AxisChangeEvent
is sent to all registered
listeners.
flag | the flag. |
---|
Converts a data value to a coordinate in Java2D space, assuming that the axis runs along one edge of the specified dataArea.
Note that it is possible for the coordinate to fall outside the area.
value | the data value. |
---|---|
area | the area for plotting the data. |
edge | the edge along which the axis lies. |
Zooms in on the current range.
lowerPercent | the new lower bound. |
---|---|
upperPercent | the new upper bound. |
Automatically sets the axis range to fit the range of values in the dataset. Sometimes this can depend on the renderer used as well (for example, the renderer may "stack" values, requiring an axis range greater than otherwise necessary).
Calculates the anchor point for a tick label.
tick | the tick. |
---|---|
cursor | the cursor. |
dataArea | the data area. |
edge | the edge on which the axis is drawn. |
Draws an axis line at the current cursor position and edge.
g2 | the graphics device. |
---|---|
cursor | the cursor position. |
dataArea | the data area. |
edge | the edge. |
Draws the axis line, tick marks and tick mark labels.
g2 | the graphics device. |
---|---|
cursor | the cursor. |
plotArea | the plot area. |
dataArea | the data area. |
edge | the edge that the axis is aligned with. |
A utility method for determining the height of the tallest tick label.
ticks | the ticks. |
---|---|
g2 | the graphics device. |
drawArea | the area within which the plot and axes should be drawn. |
vertical | a flag that indicates whether or not the tick labels are 'vertical'. |
A utility method for determining the width of the widest tick label.
ticks | the ticks. |
---|---|
g2 | the graphics device. |
drawArea | the area within which the plot and axes should be drawn. |
vertical | a flag that indicates whether or not the tick labels are 'vertical'. |
Sets the auto range attribute. If the notify
flag is set,
an AxisChangeEvent
is sent to registered listeners.
auto | the flag. |
---|---|
notify | notify listeners? |