|
||||||||||
| 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.CategoryAxis
|
+--org.jfree.chart.axis.HorizontalCategoryAxis
A horizontal axis that displays categories. Used for bar charts and line charts.
Note: the axis needs to rely on the plot for assistance with the placement of category labels, since the plot controls how the categories are distributed.
| Field Summary | |
static boolean |
DEFAULT_VERTICAL_CATEGORY_LABELS
The default setting for vertical category labels. |
| Fields inherited from class org.jfree.chart.axis.CategoryAxis |
DEFAULT_AXIS_MARGIN, DEFAULT_CATEGORY_MARGIN |
| Constructor Summary | |
HorizontalCategoryAxis(java.lang.String label)
Creates a new axis using default attribute values. |
|
| Method Summary | |
void |
configure()
Configures the axis against the current plot. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea,
int location)
Draws the axis on a Java 2D graphics device (such as the screen or a printer). |
boolean |
equals(java.lang.Object obj)
Tests this axis for equality with another object. |
double |
getCategoryEnd(int category,
int categoryCount,
java.awt.geom.Rectangle2D area)
Returns the end coordinate for the specified category. |
double |
getCategoryMiddle(int category,
int categoryCount,
java.awt.geom.Rectangle2D area)
Returns the middle coordinate for the specified category. |
double |
getCategoryStart(int category,
int categoryCount,
java.awt.geom.Rectangle2D area)
Returns the starting coordinate for the specified category. |
protected double |
getMaxTickLabelWidth(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea)
Returns the maximum width of the ticks in the working list (that is set up by refreshTicks()). |
boolean |
getSkipCategoryLabelsToFit()
Returns the flag that determines whether the category labels are to be skipped to avoid overlapping. |
boolean |
getVerticalCategoryLabels()
Returns a flag indicating whether the category labels are drawn 'vertically'. |
protected boolean |
isCompatiblePlot(Plot plot)
Returns true if the specified plot is compatible with the axis. |
void |
refreshTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea,
int location)
Creates a temporary list of ticks that can be used when drawing the axis. |
double |
reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
int location)
Estimates the height required for the axis, given a specific drawing area, without any information about the width of the vertical axis. |
double |
reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
int location,
double reservedWidth,
int verticalAxisLocation)
Returns the area required to draw the axis in the specified draw area. |
void |
setSkipCategoryLabelsToFit(boolean flag)
Sets the flag that determines whether the category labels are to be skipped to avoid overlapping. |
void |
setVerticalCategoryLabels(boolean flag)
Sets the flag that determines whether the category labels are drawn 'vertically'. |
void |
setVerticalTickLabels(boolean flag)
Sets the flag that determines whether the category labels are drawn 'vertically'. |
| Methods inherited from class org.jfree.chart.axis.CategoryAxis |
getCategoryMargin, getLowerMargin, getUpperMargin, setCategoryMargin, setLowerMargin, setUpperMargin |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final boolean DEFAULT_VERTICAL_CATEGORY_LABELS
| Constructor Detail |
public HorizontalCategoryAxis(java.lang.String label)
label - the axis label (null permitted).| Method Detail |
public boolean getVerticalCategoryLabels()
public void setVerticalCategoryLabels(boolean flag)
flag - the new value of the flag.public void setVerticalTickLabels(boolean flag)
You should use the setVerticalCategoryLabels method - this method just passed over to it anyway.
flag - the new value of the flag.public boolean getSkipCategoryLabelsToFit()
public void setSkipCategoryLabelsToFit(boolean flag)
flag - the new value of the flag.
public double getCategoryStart(int category,
int categoryCount,
java.awt.geom.Rectangle2D area)
getCategoryStart in class CategoryAxiscategory - the category.categoryCount - the number of categories.area - the data area.
public double getCategoryMiddle(int category,
int categoryCount,
java.awt.geom.Rectangle2D area)
getCategoryMiddle in class CategoryAxiscategory - the category.categoryCount - the number of categories.area - the data area.
public double getCategoryEnd(int category,
int categoryCount,
java.awt.geom.Rectangle2D area)
getCategoryEnd in class CategoryAxiscategory - the category.categoryCount - the number of categories.area - the data area.
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea,
int location)
draw in class Axisg2 - the graphics device.plotArea - the area within which the axis should be drawn.dataArea - the area within which the plot is being drawn.location - the location of the axis (TOP or BOTTOM).
public void refreshTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea,
int location)
refreshTicks in class Axisg2 - the graphics device (used to get font measurements).plotArea - the area where the plot and axes will be drawn.dataArea - the area inside the axes.location - the location of the axis.
public double reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
int location)
Supports the HorizontalAxis interface.
reserveHeight in interface HorizontalAxisg2 - the graphics device (used to obtain font information).plot - the plot that the axis belongs to.drawArea - the area within which the axis should be drawn.location - the axis location (top or bottom).
public double reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
int location,
double reservedWidth,
int verticalAxisLocation)
reserveHeight in interface HorizontalAxisg2 - the graphics device.plot - the plot that the axis belongs to.drawArea - the area within which the plot should be drawn.location - the location of the axis.reservedWidth - the width reserved by the vertical axis.verticalAxisLocation - the location of the vertical axis.
protected double getMaxTickLabelWidth(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea)
getMaxTickLabelWidth in class Axisg2 - the graphics device.plotArea - the area within which the plot is to be drawn.
protected boolean isCompatiblePlot(Plot plot)
isCompatiblePlot in class Axisplot - The plot.
true if the specified plot is compatible with the axis.public void configure()
configure in class Axispublic boolean equals(java.lang.Object obj)
equals in class CategoryAxisobj - the object.
true or false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||