Package org.jfree.chart.title
Class LegendTitle
java.lang.Object
org.jfree.chart.title.Title
org.jfree.chart.title.LegendTitle
- All Implemented Interfaces:
Serializable
,Cloneable
public abstract class LegendTitle extends Title
A chart title that displays a legend for the data in the chart.
The title can be populated with legend items manually, or you can assign a reference to the chart, in which case the legend items will be automatically created to match the dataset.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.jfree.chart.title.Title
BOTTOM, CENTER, DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_POSITION, DEFAULT_SPACER, DEFAULT_VERTICAL_ALIGNMENT, EAST, LEFT, MIDDLE, NORTH, RIGHT, SOUTH, TOP, WEST
-
Constructor Summary
Constructors Constructor Description LegendTitle()
Constructs a new, empty LegendTitle.LegendTitle(LegendItemLayout layout)
Creates a new legend title. -
Method Summary
Modifier and Type Method Description void
addLegendItem(LegendItem item)
Adds a legend item to the LegendTitle.void
draw(Graphics2D g2, Rectangle2D area)
Draws the title on a Java 2D graphics device (such as the screen or a printer).Methods inherited from class org.jfree.chart.title.Title
addChangeListener, clone, equals, getHorizontalAlignment, getNotify, getPosition, getPreferredHeight, getPreferredWidth, getSpacer, getVerticalAlignment, hashCode, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setSpacer, setVerticalAlignment
-
Constructor Details
-
LegendTitle
public LegendTitle()Constructs a new, empty LegendTitle. -
LegendTitle
Creates a new legend title.- Parameters:
layout
- the layout.
-
-
Method Details
-
addLegendItem
Adds a legend item to the LegendTitle.- Parameters:
item
- the item to add.
-
draw
Draws the title on a Java 2D graphics device (such as the screen or a printer). Currently it does nothing.
-