Package org.jfree.chart.axis
Class CategoryLabelPosition
java.lang.Object
org.jfree.chart.axis.CategoryLabelPosition
- All Implemented Interfaces:
Serializable
public class CategoryLabelPosition extends Object implements Serializable
The attributes that control the position of the labels for the categories on
a
CategoryAxis. Instances of this class are immutable and other
JFreeChart classes rely upon this.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description CategoryLabelPosition()Creates a new position record with default settings.CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor)Creates a new category label position record.CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor, CategoryLabelWidthType widthType, float widthRatio)Creates a new category label position record.CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor, org.jfree.ui.TextAnchor rotationAnchor, double angle)Deprecated.Use alternative constructor.CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor, org.jfree.ui.TextAnchor rotationAnchor, double angle, CategoryLabelWidthType widthType, float widthRatio)Creates a new position record. -
Method Summary
Modifier and Type Method Description booleanequals(Object object)Tests an object for equality with this instance.doublegetAngle()Returns the angle of rotation for the label.org.jfree.ui.RectangleAnchorgetCategoryAnchor()Returns the item label anchor.org.jfree.text.TextBlockAnchorgetLabelAnchor()Returns the text block anchor.org.jfree.ui.TextAnchorgetRotationAnchor()Returns the rotation anchor point.floatgetWidthRatio()Returns the ratio used to calculate the maximum category label width.CategoryLabelWidthTypegetWidthType()Returns the width calculation type.
-
Constructor Details
-
CategoryLabelPosition
public CategoryLabelPosition()Creates a new position record with default settings. -
CategoryLabelPosition
public CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor)Creates a new category label position record.- Parameters:
categoryAnchor- the category anchor (nullnot permitted).labelAnchor- the label anchor (nullnot permitted).
-
CategoryLabelPosition
public CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor, CategoryLabelWidthType widthType, float widthRatio)Creates a new category label position record.- Parameters:
categoryAnchor- the category anchor (nullnot permitted).labelAnchor- the label anchor (nullnot permitted).widthType- the width type (nullnot permitted).widthRatio- the maximum label width as a percentage (of the category space or the range space).
-
CategoryLabelPosition
public CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor, org.jfree.ui.TextAnchor rotationAnchor, double angle)Deprecated.Use alternative constructor.Creates a new position record. The item label anchor is a point relative to the data item (dot, bar or other visual item) on a chart. The item label is aligned by aligning the text anchor with the item label anchor.- Parameters:
categoryAnchor- the category anchor (nullnot permitted).labelAnchor- the label anchor (nullnot permitted).rotationAnchor- the rotation anchor (nullnot permitted).angle- the rotation angle (nullnot permitted).
-
CategoryLabelPosition
public CategoryLabelPosition(org.jfree.ui.RectangleAnchor categoryAnchor, org.jfree.text.TextBlockAnchor labelAnchor, org.jfree.ui.TextAnchor rotationAnchor, double angle, CategoryLabelWidthType widthType, float widthRatio)Creates a new position record. The item label anchor is a point relative to the data item (dot, bar or other visual item) on a chart. The item label is aligned by aligning the text anchor with the item label anchor.- Parameters:
categoryAnchor- the category anchor (nullnot permitted).labelAnchor- the label anchor (nullnot permitted).rotationAnchor- the rotation anchor (nullnot permitted).angle- the rotation angle (nullnot permitted).widthType- the width type (nullnot permitted).widthRatio- the maximum label width as a percentage (of the category space or the range space).
-
-
Method Details
-
getCategoryAnchor
public org.jfree.ui.RectangleAnchor getCategoryAnchor()Returns the item label anchor.- Returns:
- the item label anchor (never
null).
-
getLabelAnchor
public org.jfree.text.TextBlockAnchor getLabelAnchor()Returns the text block anchor.- Returns:
- the text block anchor (never
null).
-
getRotationAnchor
public org.jfree.ui.TextAnchor getRotationAnchor()Returns the rotation anchor point.- Returns:
- the rotation anchor point (never
null).
-
getAngle
public double getAngle()Returns the angle of rotation for the label.- Returns:
- the angle (in radians).
-
getWidthType
Returns the width calculation type.- Returns:
- The width calculation type.
-
getWidthRatio
public float getWidthRatio()Returns the ratio used to calculate the maximum category label width.- Returns:
- The ratio.
-
equals
Tests an object for equality with this instance.
-