java.lang.Object | ||
↳ | org.jfree.chart.labels.AbstractPieItemLabelGenerator | |
↳ | org.jfree.chart.labels.StandardPieSectionLabelGenerator |
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%)
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_SECTION_LABEL_FORMAT | The default section label format. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new section label generator using
DEFAULT_SECTION_LABEL_FORMAT as the label format string, and
platform default number and percentage formatters. | |||||||||||
Creates a new instance for the specified locale.
| |||||||||||
Creates a new section label generator using the specified label format
string, and platform default number and percentage formatters.
| |||||||||||
Creates a new instance for the specified locale.
| |||||||||||
Creates an item label generator using the specified number formatters.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an independent copy of the generator.
| |||||||||||
Tests the generator for equality with an arbitrary object.
| |||||||||||
Generates an attributed label for the specified series, or
null if no attributed label is available (in which case,
the string returned by
generateSectionLabel(PieDataset, Comparable) will
provide the fallback). | |||||||||||
Generates a label for a pie section.
| |||||||||||
Returns the attributed label for a section, or
null if none
is defined. | |||||||||||
Sets the attributed label for a section.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
The default section label format.
Creates a new section label generator using
DEFAULT_SECTION_LABEL_FORMAT
as the label format string, and
platform default number and percentage formatters.
Creates a new instance for the specified locale.
locale | the local (null not permitted). |
---|
Creates a new section label generator using the specified label format string, and platform default number and percentage formatters.
labelFormat | the label format (null not permitted).
|
---|
Creates a new instance for the specified locale.
labelFormat | the label format (null not permitted). |
---|---|
locale | the local (null not permitted). |
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).
|
Returns an independent copy of the generator.
CloneNotSupportedException | should not happen. |
---|
Tests the generator for equality with an arbitrary object.
obj | the object to test against (null permitted). |
---|
Generates an attributed label for the specified series, or
null
if no attributed label is available (in which case,
the string returned by
generateSectionLabel(PieDataset, Comparable)
will
provide the fallback). Only certain attributes are recognised by the
code that ultimately displays the labels:
FONT
: will set the font;POSTURE
: a value of
POSTURE_OBLIQUE
will add ITALIC
to
the current font;WEIGHT
: a value of
WEIGHT_BOLD
will add BOLD
to the
current font;FOREGROUND
: this will set the Paint
for the currentSUPERSCRIPT
: the values
SUPERSCRIPT_SUB
and
SUPERSCRIPT_SUPER
are recognised.dataset | the dataset (null not permitted). |
---|---|
key | the key. |
null
).
Generates a label for a pie section.
dataset | the dataset (null not permitted). |
---|---|
key | the section key (null not permitted). |
null
).
Returns the attributed label for a section, or null
if none
is defined.
section | the section index. |
---|
Sets the attributed label for a section.
section | the section index. |
---|---|
label | the label (null permitted).
|