org.jfree.chart.labels
Class StandardPieToolTipGenerator
- Cloneable, PieToolTipGenerator, PublicCloneable, Serializable
A standard item label generator for plots that use data from a
PieDataset
.
For the label format, use {0} where the pie section key should be inserted,
{1} for the absolute section value and {2} for the percent amount of the pie
section, e.g.
"{0} = {1} ({2})"
will display as
apple = 120 (5%)
.
Object | clone() - Returns an independent copy of the generator.
|
String | generateToolTip(PieDataset dataset, Comparable key) - Generates a tool tip text item for one section in a pie chart.
|
StandardPieToolTipGenerator
public StandardPieToolTipGenerator(String labelFormat)
Creates an item label generator.
labelFormat
- the label format.
StandardPieToolTipGenerator
public StandardPieToolTipGenerator(String labelFormat,
NumberFormat numberFormat,
NumberFormat percentFormat)
Creates an item label generator using the specified number formatters.
labelFormat
- the label format string (null
not
permitted).numberFormat
- the format object for the values (null
not permitted).percentFormat
- the format object for the percentages
(null
not permitted).
generateToolTip
public String generateToolTip(PieDataset dataset,
Comparable key)
Generates a tool tip text item for one section in a pie chart.
- generateToolTip in interface PieToolTipGenerator
dataset
- the dataset (null
not permitted).key
- the section key (null
not permitted).
- The tool tip text (possibly
null
).