java.lang.Object | ||
↳ | org.jfree.chart.axis.Axis | |
↳ | org.jfree.chart.axis.CategoryAxis |
![]() |
An axis that displays categories.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
double | DEFAULT_AXIS_MARGIN | The default margin for the axis (used for both lower and upper margins). | |||||||||
double | DEFAULT_CATEGORY_MARGIN | The default margin between categories (a percentage of the overall axis length). |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new category axis with no label.
| |||||||||||
Constructs a category axis, using default values where necessary.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a tooltip to the specified category and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Clears the category label tooltips and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Creates a clone of the axis.
| |||||||||||
Configures the axis against the current plot.
| |||||||||||
Draws the axis on a Java 2D graphics device (such as the screen or a
printer).
| |||||||||||
Draws the tick marks.
| |||||||||||
Tests this axis for equality with an arbitrary object.
| |||||||||||
Returns the end coordinate for the specified category.
| |||||||||||
Returns the Java 2D coordinate for a category.
| |||||||||||
Returns the offset between the axis and the category labels (before
label positioning is taken into account).
| |||||||||||
Returns the category label position specification (this contains label
positioning info for all four possible axis locations).
| |||||||||||
Returns the tool tip text for the label belonging to the specified
category.
| |||||||||||
Returns the category margin.
| |||||||||||
A convenience method that returns the axis coordinate for the centre of
a category.
| |||||||||||
Returns the middle coordinate for the specified category.
| |||||||||||
Returns the middle coordinate (in Java2D space) for a series within a
category.
| |||||||||||
Returns the middle coordinate (in Java2D space) for a series within a
category.
| |||||||||||
Returns the starting coordinate for the specified category.
| |||||||||||
Returns the lower margin for the axis.
| |||||||||||
Returns the maximum number of lines to use for each category label.
| |||||||||||
Returns the category label width ratio.
| |||||||||||
Returns the font for the tick label for the given category.
| |||||||||||
Returns the paint for the tick label for the given category.
| |||||||||||
Returns the upper margin for the axis.
| |||||||||||
Returns a hash code for this object.
| |||||||||||
Creates a temporary list of ticks that can be used when drawing the axis.
| |||||||||||
Removes the tooltip for the specified category and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Estimates the space required for the axis, given a specific drawing area.
| |||||||||||
Sets the offset between the axis and the category labels (before label
positioning is taken into account).
| |||||||||||
Sets the category label position specification for the axis and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the category margin and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the lower margin for the axis and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Sets the maximum number of lines to use for each category label and
sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the maximum category label width ratio and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the font for the tick label for the specified category and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the paint for the tick label for the specified category and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the upper margin for the axis and sends an
AxisChangeEvent
to all registered listeners. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Calculates the size (width or height, depending on the location of the
axis) of a category gap.
| |||||||||||
Calculates the size (width or height, depending on the location of the
axis) of a category.
| |||||||||||
A utility method for determining the height of a text block.
| |||||||||||
A utility method for determining the width of a text block.
| |||||||||||
Creates a label.
| |||||||||||
Draws the category labels and returns the updated axis state.
| |||||||||||
This method is deprecated.
Use
drawCategoryLabels(Graphics2D, Rectangle2D, Rectangle2D, RectangleEdge, AxisState, PlotRenderingInfo) .
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
The default margin for the axis (used for both lower and upper margins).
The default margin between categories (a percentage of the overall axis length).
Creates a new category axis with no label.
Constructs a category axis, using default values where necessary.
label | the axis label (null permitted).
|
---|
Adds a tooltip to the specified category and sends an
AxisChangeEvent
to all registered listeners.
category | the category (null |
---|---|
tooltip | the tooltip text (null permitted). |
Clears the category label tooltips and sends an AxisChangeEvent
to all registered listeners.
Creates a clone of the axis.
CloneNotSupportedException | if some component of the axis does not support cloning. |
---|
Configures the axis against the current plot.
Draws the axis on a Java 2D graphics device (such as the screen or a printer).
g2 | the graphics device (null not permitted). |
---|---|
cursor | the cursor location. |
plotArea | the area within which the axis should be drawn
(null not permitted). |
dataArea | the area within which the plot is being drawn
(null not permitted). |
edge | the location of the axis (null not permitted). |
plotState | collects information about the plot
(null permitted). |
null
).
Draws the tick marks.
Tests this axis for equality with an arbitrary object.
obj | the object (null permitted). |
---|
Returns the end coordinate for the specified category.
category | the category. |
---|---|
categoryCount | the number of categories. |
area | the data area. |
edge | the axis location. |
Returns the Java 2D coordinate for a category.
anchor | the anchor point. |
---|---|
category | the category index. |
categoryCount | the category count. |
area | the data area. |
edge | the location of the axis. |
Returns the offset between the axis and the category labels (before label positioning is taken into account).
Returns the category label position specification (this contains label positioning info for all four possible axis locations).
null
).Returns the tool tip text for the label belonging to the specified category.
category | the category (null not permitted). |
---|
null
).A convenience method that returns the axis coordinate for the centre of a category.
category | the category key (null not permitted). |
---|---|
categories | the categories (null not permitted). |
area | the data area (null not permitted). |
edge | the edge along which the axis lies (null not
permitted). |
Returns the middle coordinate for the specified category.
category | the category. |
---|---|
categoryCount | the number of categories. |
area | the data area. |
edge | the axis location. |
Returns the middle coordinate (in Java2D space) for a series within a category.
category | the category (null not permitted). |
---|---|
seriesKey | the series key (null not permitted). |
dataset | the dataset (null not permitted). |
itemMargin | the item margin (0.0 <= itemMargin < 1.0); |
area | the area (null not permitted). |
edge | the edge (null not permitted). |
Returns the middle coordinate (in Java2D space) for a series within a category.
categoryIndex | the category index. |
---|---|
categoryCount | the category count. |
seriesIndex | the series index. |
seriesCount | the series count. |
itemMargin | the item margin (0.0 <= itemMargin < 1.0); |
area | the area (null not permitted). |
edge | the edge (null not permitted). |
Returns the starting coordinate for the specified category.
category | the category. |
---|---|
categoryCount | the number of categories. |
area | the data area. |
edge | the axis location. |
Returns the lower margin for the axis.
Returns the maximum number of lines to use for each category label.
Returns the category label width ratio.
Returns the font for the tick label for the given category.
category | the category (null not permitted). |
---|
null
).Returns the paint for the tick label for the given category.
category | the category (null not permitted). |
---|
null
).Returns the upper margin for the axis.
Returns a hash code for this object.
Creates a temporary list of ticks that can be used when drawing the axis.
g2 | the graphics device (used to get font measurements). |
---|---|
state | the axis state. |
dataArea | the area inside the axes. |
edge | the location of the axis. |
Removes the tooltip for the specified category and sends an
AxisChangeEvent
to all registered listeners.
category | the category (null |
---|
Estimates the space required for the axis, given a specific drawing area.
g2 | the graphics device (used to obtain font information). |
---|---|
plot | the plot that the axis belongs to. |
plotArea | the area within which the axis should be drawn. |
edge | the axis location (top or bottom). |
space | the space already reserved. |
Sets the offset between the axis and the category labels (before label positioning is taken into account).
offset | the offset (in Java2D units). |
---|
Sets the category label position specification for the axis and sends an
AxisChangeEvent
to all registered listeners.
positions | the positions (null not permitted). |
---|
Sets the category margin and sends an AxisChangeEvent
to all
registered listeners. The overall category margin is distributed over
N-1 gaps, where N is the number of categories on the axis.
margin | the margin as a percentage of the axis length (for example, 0.05 is five percent). |
---|
Sets the lower margin for the axis and sends an AxisChangeEvent
to all registered listeners.
margin | the margin as a percentage of the axis length (for example, 0.05 is five percent). |
---|
Sets the maximum number of lines to use for each category label and
sends an AxisChangeEvent
to all registered listeners.
lines | the maximum number of lines. |
---|
Sets the maximum category label width ratio and sends an
AxisChangeEvent
to all registered listeners.
ratio | the ratio. |
---|
Sets the font for the tick label for the specified category and sends
an AxisChangeEvent
to all registered listeners.
category | the category (null not permitted). |
---|---|
font | the font (null permitted). |
Sets the paint for the tick label for the specified category and sends
an AxisChangeEvent
to all registered listeners.
category | the category (null not permitted). |
---|---|
paint | the paint (null permitted). |
Sets the upper margin for the axis and sends an AxisChangeEvent
to all registered listeners.
margin | the margin as a percentage of the axis length (for example, 0.05 is five percent). |
---|
Calculates the size (width or height, depending on the location of the axis) of a category gap.
categoryCount | the number of categories. |
---|---|
area | the area within which the categories will be drawn. |
edge | the axis location. |
Calculates the size (width or height, depending on the location of the axis) of a category.
categoryCount | the number of categories. |
---|---|
area | the area within which the categories will be drawn. |
edge | the axis location. |
A utility method for determining the height of a text block.
block | the text block. |
---|---|
position | the label position. |
g2 | the graphics device. |
A utility method for determining the width of a text block.
block | the text block. |
---|---|
position | the position. |
g2 | the graphics device. |
Creates a label.
category | the category. |
---|---|
width | the available width. |
edge | the edge on which the axis appears. |
g2 | the graphics device. |
Draws the category labels and returns the updated axis state.
g2 | the graphics device (null not permitted). |
---|---|
plotArea | the plot area (null not permitted). |
dataArea | the area inside the axes (null not
permitted). |
edge | the axis location (null not permitted). |
state | the axis state (null not permitted). |
plotState | collects information about the plot (null
permitted). |
null
).
This method is deprecated.
Use drawCategoryLabels(Graphics2D, Rectangle2D, Rectangle2D, RectangleEdge, AxisState, PlotRenderingInfo)
.
Draws the category labels and returns the updated axis state.
g2 | the graphics device (null not permitted). |
---|---|
dataArea | the area inside the axes (null not
permitted). |
edge | the axis location (null not permitted). |
state | the axis state (null not permitted). |
plotState | collects information about the plot (null
permitted). |
null
).