Package org.jfree.chart.labels
Class StandardPieToolTipGenerator
java.lang.Object
org.jfree.chart.labels.AbstractPieItemLabelGenerator
org.jfree.chart.labels.StandardPieToolTipGenerator
- All Implemented Interfaces:
Serializable
,Cloneable
,PieToolTipGenerator
,PublicCloneable
public class StandardPieToolTipGenerator
extends AbstractPieItemLabelGenerator
implements PieToolTipGenerator, Cloneable, 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%)
.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates an item label generator using default number formatters.StandardPieToolTipGenerator
(String labelFormat) Creates a pie tool tip generator for the default locale.StandardPieToolTipGenerator
(String labelFormat, NumberFormat numberFormat, NumberFormat percentFormat) Creates an item label generator using the specified number formatters.StandardPieToolTipGenerator
(String labelFormat, Locale locale) Creates a pie tool tip generator for the specified locale.StandardPieToolTipGenerator
(Locale locale) Creates a pie tool tip generator for the specified locale, using the default format string. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns an independent copy of the generator.generateToolTip
(PieDataset dataset, Comparable key) Generates a tool tip text item for one section in a pie chart.Methods inherited from class org.jfree.chart.labels.AbstractPieItemLabelGenerator
createItemArray, equals, generateSectionLabel, getLabelFormat, getNumberFormat, getPercentFormat, hashCode
-
Field Details
-
DEFAULT_TOOLTIP_FORMAT
The default tooltip format.- See Also:
-
-
Constructor Details
-
StandardPieToolTipGenerator
public StandardPieToolTipGenerator()Creates an item label generator using default number formatters. -
StandardPieToolTipGenerator
Creates a pie tool tip generator for the specified locale, using the default format string.- Parameters:
locale
- the locale (null
not permitted).
-
StandardPieToolTipGenerator
Creates a pie tool tip generator for the default locale.- Parameters:
labelFormat
- the label format (null
not permitted).
-
StandardPieToolTipGenerator
Creates a pie tool tip generator for the specified locale.- Parameters:
labelFormat
- the label format (null
not permitted).locale
- the locale (null
not permitted).
-
StandardPieToolTipGenerator
public StandardPieToolTipGenerator(String labelFormat, NumberFormat numberFormat, NumberFormat percentFormat) Creates an item label generator using the specified number formatters.- Parameters:
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).
-
-
Method Details
-
generateToolTip
Generates a tool tip text item for one section in a pie chart.- Specified by:
generateToolTip
in interfacePieToolTipGenerator
- Parameters:
dataset
- the dataset (null
not permitted).key
- the section key (null
not permitted).- Returns:
- The tool tip text (possibly
null
).
-
clone
Returns an independent copy of the generator.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classAbstractPieItemLabelGenerator
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- should not happen.
-