Module org.jfree.chart
Package org.jfree.chart.labels
Interface PieSectionLabelGenerator<K extends Comparable<K>>
-
- All Known Implementing Classes:
StandardPieSectionLabelGenerator
public interface PieSectionLabelGenerator<K extends Comparable<K>>
Interface for a label generator for plots that use data from aPieDataset.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AttributedStringgenerateAttributedSectionLabel(PieDataset<K> dataset, K key)Generates an attributed label for the specified series, ornullif no attributed label is available (in which case, the string returned bygenerateSectionLabel(PieDataset, Comparable)will provide the fallback).StringgenerateSectionLabel(PieDataset<K> dataset, K key)Generates a label for a pie section.
-
-
-
Method Detail
-
generateSectionLabel
String generateSectionLabel(PieDataset<K> dataset, K key)
Generates a label for a pie section.- Parameters:
dataset- the dataset (nullnot permitted).key- the section key (nullnot permitted).- Returns:
- The label (possibly
null).
-
generateAttributedSectionLabel
AttributedString generateAttributedSectionLabel(PieDataset<K> dataset, K key)
Generates an attributed label for the specified series, ornullif no attributed label is available (in which case, the string returned bygenerateSectionLabel(PieDataset, Comparable)will provide the fallback). Only certain attributes are recognised by the code that ultimately displays the labels:TextAttribute.FONT: will set the font;TextAttribute.POSTURE: a value ofTextAttribute.POSTURE_OBLIQUEwill addFont.ITALICto the current font;TextAttribute.WEIGHT: a value ofTextAttribute.WEIGHT_BOLDwill addFont.BOLDto the current font;TextAttribute.FOREGROUND: this will set thePaintfor the currentTextAttribute.SUPERSCRIPT: the valuesTextAttribute.SUPERSCRIPT_SUBandTextAttribute.SUPERSCRIPT_SUPERare recognised.
- Parameters:
dataset- the dataset.key- the key.- Returns:
- An attributed label (possibly
null).
-
-