- java.lang.Object
-
- org.jfree.chart.labels.AbstractPieItemLabelGenerator
-
- org.jfree.chart.labels.StandardPieToolTipGenerator
-
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable,PieToolTipGenerator
public class StandardPieToolTipGenerator extends AbstractPieItemLabelGenerator implements PieToolTipGenerator, Cloneable, PublicCloneable, Serializable
A standard item label generator for plots that use data from aPieDataset.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 asapple = 120 (5%).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TOOLTIP_FORMATThe default tooltip format.
-
Constructor Summary
Constructors Constructor Description StandardPieToolTipGenerator()Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns an independent copy of the generator.StringgenerateToolTip(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 Detail
-
DEFAULT_TOOLTIP_FORMAT
public static final String DEFAULT_TOOLTIP_FORMAT
The default tooltip format.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StandardPieToolTipGenerator
public StandardPieToolTipGenerator()
Creates an item label generator using default number formatters.
-
StandardPieToolTipGenerator
public StandardPieToolTipGenerator(Locale locale)
Creates a pie tool tip generator for the specified locale, using the default format string.- Parameters:
locale- the locale (nullnot permitted).
-
StandardPieToolTipGenerator
public StandardPieToolTipGenerator(String labelFormat)
Creates a pie tool tip generator for the default locale.- Parameters:
labelFormat- the label format (nullnot permitted).
-
StandardPieToolTipGenerator
public StandardPieToolTipGenerator(String labelFormat, Locale locale)
Creates a pie tool tip generator for the specified locale.- Parameters:
labelFormat- the label format (nullnot permitted).locale- the locale (nullnot 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 (nullnot permitted).numberFormat- the format object for the values (nullnot permitted).percentFormat- the format object for the percentages (nullnot permitted).
-
-
Method Detail
-
generateToolTip
public String generateToolTip(PieDataset dataset, Comparable key)
Generates a tool tip text item for one section in a pie chart.- Specified by:
generateToolTipin interfacePieToolTipGenerator- Parameters:
dataset- the dataset (nullnot permitted).key- the section key (nullnot permitted).- Returns:
- The tool tip text (possibly
null).
-
clone
public Object clone() throws CloneNotSupportedException
Returns an independent copy of the generator.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractPieItemLabelGenerator- Returns:
- A clone.
- Throws:
CloneNotSupportedException- should not happen.
-
-