java.lang.Object | ||
↳ | org.jfree.chart.plot.Plot | |
↳ | org.jfree.chart.plot.PiePlot |
![]() |
A plot that displays data in the form of a pie chart, using data from any
class that implements the PieDataset
interface.
The example shown here is generated by the PieChartDemo2.java
program included in the JFreeChart Demo Collection:
Special notes:
PieDataset
from a
CategoryDataset
;Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
double | DEFAULT_INTERIOR_GAP | The default interior gap. | |||||||||
double | DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW | The default minimum arc angle to draw. | |||||||||
double | DEFAULT_START_ANGLE | The default starting angle for the pie chart. | |||||||||
double | MAX_INTERIOR_GAP | The maximum interior gap (currently 40%). |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_LABEL_BACKGROUND_PAINT | The default section label background paint. | ||||||||||
DEFAULT_LABEL_FONT | The default section label font. | ||||||||||
DEFAULT_LABEL_OUTLINE_PAINT | The default section label outline paint. | ||||||||||
DEFAULT_LABEL_OUTLINE_STROKE | The default section label outline stroke. | ||||||||||
DEFAULT_LABEL_PAINT | The default section label paint. | ||||||||||
DEFAULT_LABEL_SHADOW_PAINT | The default section label shadow paint. | ||||||||||
localizationResources | The resourceBundle for the localization. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new plot.
| |||||||||||
Creates a plot that will draw a pie chart for the specified dataset.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clears the section outline paint settings for this plot and, if
requested, sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Clears the section outline stroke settings for this plot and, if
requested, sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Clears the section paint settings for this plot and, if requested, sends
a
PlotChangeEvent to all registered listeners. | |||||||||||
Returns a clone of the plot.
| |||||||||||
Draws the plot on a Java 2D graphics device (such as the screen or a
printer).
| |||||||||||
Tests this plot for equality with an arbitrary object.
| |||||||||||
Returns the flag that controls whether or not the section outline paint
is auto-populated by the
lookupSectionOutlinePaint(Comparable)
method. | |||||||||||
Returns the flag that controls whether or not the section outline stroke
is auto-populated by the
lookupSectionOutlinePaint(Comparable)
method. | |||||||||||
Returns the flag that controls whether or not the section paint is
auto-populated by the
lookupSectionPaint(Comparable) method. | |||||||||||
Returns the base section paint.
| |||||||||||
Returns the base section stroke.
| |||||||||||
Returns the base section paint.
| |||||||||||
Returns the dataset.
| |||||||||||
Returns the direction in which the pie sections are drawn (clockwise or
anti-clockwise).
| |||||||||||
Returns the amount that the section with the specified key should be
exploded.
| |||||||||||
This method is deprecated.
Use
getExplodePercent(Comparable) instead.
| |||||||||||
Returns the flag that controls whether
null values in the
dataset are ignored. | |||||||||||
Returns the flag that controls whether zero values in the
dataset are ignored.
| |||||||||||
Returns the interior gap, measured as a percentage of the available
drawing space.
| |||||||||||
Returns the section label background paint.
| |||||||||||
Returns the object responsible for the vertical layout of the pie
section labels.
| |||||||||||
Returns the section label font.
| |||||||||||
Returns the gap between the edge of the pie and the labels, expressed as
a percentage of the plot width.
| |||||||||||
Returns the section label generator.
| |||||||||||
Returns the margin (expressed as a percentage of the width or height)
between the edge of the pie and the link point.
| |||||||||||
Returns the paint used for the lines that connect pie sections to their
corresponding labels.
| |||||||||||
Returns the stroke used for the label linking lines.
| |||||||||||
Returns the label link style.
| |||||||||||
Returns the flag that controls whether or not label linking lines are
visible.
| |||||||||||
Returns the section label outline paint.
| |||||||||||
Returns the section label outline stroke.
| |||||||||||
Returns the label padding.
| |||||||||||
Returns the section label paint.
| |||||||||||
Returns the section label shadow paint.
| |||||||||||
Returns the shape used for legend items.
| |||||||||||
Returns a collection of legend items for the pie chart.
| |||||||||||
Returns the legend label generator.
| |||||||||||
Returns the legend label tool tip generator.
| |||||||||||
Returns the legend label URL generator.
| |||||||||||
Returns the maximum explode percent.
| |||||||||||
Returns the maximum label width as a percentage of the plot width.
| |||||||||||
Returns the minimum arc angle that will be drawn.
| |||||||||||
Returns the pie index (this is used by the
MultiplePiePlot class
to track subplots). | |||||||||||
Returns a short string describing the type of plot.
| |||||||||||
Returns the outline paint associated with the specified key, or
null if there is no paint associated with the key. | |||||||||||
This method is deprecated.
Use
getSectionOutlinePaint(Comparable) and
getBaseSectionOutlinePaint() . Deprecated as of version
1.0.6.
| |||||||||||
This method is deprecated.
Use
getSectionOutlinePaint(Comparable) instead.
| |||||||||||
This method is deprecated.
Use
getSectionOutlineStroke(Comparable) and
getBaseSectionOutlineStroke() . Deprecated as of version
1.0.6.
| |||||||||||
Returns the outline stroke associated with the specified key, or
null if there is no stroke associated with the key. | |||||||||||
This method is deprecated.
Use
getSectionOutlineStroke(Comparable) instead.
| |||||||||||
Returns the flag that controls whether or not the outline is drawn for
each pie section.
| |||||||||||
This method is deprecated.
Use
getSectionPaint(Comparable) and
getBaseSectionPaint() . Deprecated as of version 1.0.6.
| |||||||||||
This method is deprecated.
Use
getSectionPaint(Comparable) instead.
| |||||||||||
Returns the paint associated with the specified key, or
null if there is no paint associated with the key. | |||||||||||
Returns the shadow paint.
| |||||||||||
Returns the x-offset for the shadow effect.
| |||||||||||
Returns the y-offset for the shadow effect.
| |||||||||||
Returns the offset used for the simple labels, if they are displayed.
| |||||||||||
Returns the flag that controls whether simple or extended labels are
displayed on the plot.
| |||||||||||
Returns the start angle for the first pie section.
| |||||||||||
Returns the tool tip generator, an object that is responsible for
generating the text items used for tool tips by the plot.
| |||||||||||
Returns the URL generator.
| |||||||||||
Initialises the drawing procedure.
| |||||||||||
Returns a flag indicating whether the pie chart is circular, or
stretched into an elliptical shape.
| |||||||||||
Sets the flag that controls whether or not the section outline paint is
auto-populated by the
lookupSectionOutlinePaint(Comparable)
method, and sends a PlotChangeEvent to all registered listeners. | |||||||||||
Sets the flag that controls whether or not the section outline stroke is
auto-populated by the
lookupSectionOutlineStroke(Comparable)
method, and sends a PlotChangeEvent to all registered listeners. | |||||||||||
Sets the flag that controls whether or not the section paint is
auto-populated by the
lookupSectionPaint(Comparable) method,
and sends a PlotChangeEvent to all registered listeners. | |||||||||||
Sets the base section paint.
| |||||||||||
Sets the base section stroke.
| |||||||||||
Sets the base section paint and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
A flag indicating whether the pie chart is circular, or stretched into
an elliptical shape.
| |||||||||||
Sets the circular attribute and, if requested, sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the dataset and sends a
DatasetChangeEvent to 'this'. | |||||||||||
Sets the direction in which the pie sections are drawn and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the amount that a pie section should be exploded and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
This method is deprecated.
Use
setExplodePercent(Comparable, double) instead.
| |||||||||||
Sets a flag that controls whether
null values are ignored,
and sends a PlotChangeEvent to all registered listeners. | |||||||||||
Sets a flag that controls whether zero values are ignored,
and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the interior gap and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the section label background paint and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the label distributor and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the section label font and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the gap between the edge of the pie and the labels (expressed as a
percentage of the plot width) and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the section label generator and sends a
PlotChangeEvent to
all registered listeners. | |||||||||||
Sets the link margin and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the paint used for the lines that connect pie sections to their
corresponding labels, and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the link stroke and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the label link style and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the flag that controls whether or not label linking lines are
visible and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the section label outline paint and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the section label outline stroke and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the padding between each label and its outline and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the section label paint and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the section label shadow paint and sends a
PlotChangeEvent
to all registered listeners. | |||||||||||
Sets the shape used for legend items and sends a
PlotChangeEvent
to all registered listeners. | |||||||||||
Sets the legend label generator and sends a
PlotChangeEvent to
all registered listeners. | |||||||||||
Sets the legend label tool tip generator and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the legend label URL generator and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the maximum label width as a percentage of the plot width and sends
a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the minimum arc angle that will be drawn.
| |||||||||||
Sets the pie index (this is used by the
MultiplePiePlot class to
track subplots). | |||||||||||
This method is deprecated.
Use
setSectionOutlinePaint(Comparable, Paint)
instead.
| |||||||||||
Sets the outline paint associated with the specified key, and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
This method is deprecated.
Use
setSectionOutlinePaint(Comparable, Paint) and
setBaseSectionOutlinePaint(Paint) . Deprecated as of
version 1.0.6.
| |||||||||||
Sets the outline stroke associated with the specified key, and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
This method is deprecated.
Use
setSectionOutlineStroke(Comparable, Stroke)
instead.
| |||||||||||
This method is deprecated.
Use
setSectionOutlineStroke(Comparable, Stroke) and
setBaseSectionOutlineStroke(Stroke) . Deprecated as of
version 1.0.6.
| |||||||||||
Sets the flag that controls whether or not the outline is drawn for
each pie section, and sends a
PlotChangeEvent to all registered
listeners. | |||||||||||
Sets the paint associated with the specified key, and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
This method is deprecated.
Use
setSectionPaint(Comparable, Paint) and
setBaseSectionPaint(Paint) . Deprecated as of version 1.0.6.
| |||||||||||
This method is deprecated.
Use
setSectionPaint(Comparable, Paint) instead.
| |||||||||||
Sets the shadow paint and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the x-offset for the shadow effect and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the y-offset for the shadow effect and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the offset for the simple labels and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the flag that controls whether simple or extended labels are
displayed on the plot, and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the starting angle and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the tool tip generator and sends a
PlotChangeEvent to all
registered listeners. | |||||||||||
Sets the URL generator and sends a
PlotChangeEvent to all
registered listeners. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Draws a single data item.
| |||||||||||
Draws the labels for the pie sections.
| |||||||||||
Draws a section label on the left side of the pie chart.
| |||||||||||
Draws the left labels.
| |||||||||||
Draws the pie.
| |||||||||||
Draws a section label on the right side of the pie chart.
| |||||||||||
Draws the right labels.
| |||||||||||
Draws the pie section labels in the simple form.
| |||||||||||
Returns a rectangle that can be used to create a pie section (taking
into account the amount by which the pie section is 'exploded').
| |||||||||||
Returns the distance that the end of the label link is embedded into
the plot, expressed as a percentage of the plot's radius.
| |||||||||||
Returns a key for the specified section.
| |||||||||||
Returns the outline paint for the specified section.
| |||||||||||
Returns the outline paint for the specified section.
| |||||||||||
Returns the outline stroke for the specified section.
| |||||||||||
Returns the outline stroke for the specified section.
| |||||||||||
Returns the paint for the specified section.
| |||||||||||
Returns the paint for the specified section.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
The default interior gap.
The default minimum arc angle to draw.
The default starting angle for the pie chart.
The maximum interior gap (currently 40%).
The default section label background paint.
Creates a new plot. The dataset is initially set to null
.
Creates a plot that will draw a pie chart for the specified dataset.
dataset | the dataset (null permitted).
|
---|
Clears the section outline paint settings for this plot and, if
requested, sends a PlotChangeEvent
to all registered listeners.
Be aware that if the autoPopulateSectionPaint
flag is set,
the section paints may be repopulated using the same colours as before.
notify | notify listeners? |
---|
Clears the section outline stroke settings for this plot and, if
requested, sends a PlotChangeEvent
to all registered listeners.
Be aware that if the autoPopulateSectionPaint
flag is set,
the section paints may be repopulated using the same colours as before.
notify | notify listeners? |
---|
Clears the section paint settings for this plot and, if requested, sends
a PlotChangeEvent
to all registered listeners. Be aware that
if the autoPopulateSectionPaint
flag is set, the section
paints may be repopulated using the same colours as before.
notify | notify listeners? |
---|
Returns a clone of the plot.
CloneNotSupportedException | if some component of the plot does not support cloning. |
---|
Draws the plot on a Java 2D graphics device (such as the screen or a printer).
g2 | the graphics device. |
---|---|
area | the area within which the plot should be drawn. |
anchor | the anchor point (null permitted). |
parentState | the state from the parent plot, if there is one. |
info | collects info about the drawing
(null permitted).
|
Tests this plot for equality with an arbitrary object. Note that the plot's dataset is NOT included in the test for equality.
obj | the object to test against (null permitted). |
---|
true
or false
.
Returns the flag that controls whether or not the section outline paint
is auto-populated by the lookupSectionOutlinePaint(Comparable)
method.
Returns the flag that controls whether or not the section outline stroke
is auto-populated by the lookupSectionOutlinePaint(Comparable)
method.
Returns the flag that controls whether or not the section paint is
auto-populated by the lookupSectionPaint(Comparable)
method.
Returns the base section paint. This is used when no other paint is available.
null
).Returns the base section stroke. This is used when no other stroke is available.
null
).Returns the base section paint. This is used when no other paint is
defined, which is rare. The default value is Color.gray
.
null
).Returns the direction in which the pie sections are drawn (clockwise or anti-clockwise).
null
).Returns the amount that the section with the specified key should be exploded.
key | the key (null not permitted). |
---|
IllegalArgumentException | if key is
null . |
---|
This method is deprecated.
Use getExplodePercent(Comparable)
instead.
Returns the amount that a section should be 'exploded'.
section | the section number. |
---|
Returns the flag that controls whether null
values in the
dataset are ignored.
Returns the flag that controls whether zero values in the dataset are ignored.
Returns the interior gap, measured as a percentage of the available drawing space.
Returns the section label background paint.
null
).Returns the object responsible for the vertical layout of the pie section labels.
null
).Returns the gap between the edge of the pie and the labels, expressed as a percentage of the plot width.
Returns the section label generator.
null
).Returns the margin (expressed as a percentage of the width or height) between the edge of the pie and the link point.
Returns the paint used for the lines that connect pie sections to their corresponding labels.
null
).Returns the stroke used for the label linking lines.
Returns the label link style.
null
).Returns the flag that controls whether or not label linking lines are visible.
Returns the section label outline paint.
null
).Returns the section label outline stroke.
null
).Returns the label padding.
null
).Returns the section label shadow paint.
null
).Returns the shape used for legend items.
null
).Returns a collection of legend items for the pie chart.
null
).
Returns the legend label generator.
null
).Returns the legend label tool tip generator.
null
).Returns the legend label URL generator.
null
).Returns the maximum explode percent.
Returns the maximum label width as a percentage of the plot width.
Returns the minimum arc angle that will be drawn. Pie sections for an angle smaller than this are not drawn, to avoid a JDK bug.
Returns the pie index (this is used by the MultiplePiePlot
class
to track subplots).
Returns a short string describing the type of plot.
Returns the outline paint associated with the specified key, or
null
if there is no paint associated with the key.
key | the key (null not permitted). |
---|
null
.IllegalArgumentException | if key is
null . |
---|
This method is deprecated.
Use getSectionOutlinePaint(Comparable)
and
getBaseSectionOutlinePaint()
. Deprecated as of version
1.0.6.
Returns the outline paint for ALL sections in the plot.
null
).
This method is deprecated.
Use getSectionOutlinePaint(Comparable)
instead.
Returns the paint for the specified section.
section | the section index (zero-based). |
---|
null
).
This method is deprecated.
Use getSectionOutlineStroke(Comparable)
and
getBaseSectionOutlineStroke()
. Deprecated as of version
1.0.6.
Returns the outline stroke for ALL sections in the plot.
null
).Returns the outline stroke associated with the specified key, or
null
if there is no stroke associated with the key.
key | the key (null not permitted). |
---|
null
.IllegalArgumentException | if key is
null . |
---|
This method is deprecated.
Use getSectionOutlineStroke(Comparable)
instead.
Returns the stroke for the specified section.
section | the section index (zero-based). |
---|
null
).Returns the flag that controls whether or not the outline is drawn for each pie section.
This method is deprecated.
Use getSectionPaint(Comparable)
and
getBaseSectionPaint()
. Deprecated as of version 1.0.6.
Returns the paint for ALL sections in the plot.
null
).
This method is deprecated.
Use getSectionPaint(Comparable)
instead.
Returns the paint for the specified section.
section | the section index (zero-based). |
---|
null
).Returns the paint associated with the specified key, or
null
if there is no paint associated with the key.
key | the key (null not permitted). |
---|
null
.IllegalArgumentException | if key is
null . |
---|
Returns the x-offset for the shadow effect.
Returns the y-offset for the shadow effect.
Returns the offset used for the simple labels, if they are displayed.
null
).Returns the flag that controls whether simple or extended labels are displayed on the plot.
Returns the start angle for the first pie section. This is measured in degrees starting from 3 o'clock and measuring anti-clockwise.
Returns the tool tip generator, an object that is responsible for
generating the text items used for tool tips by the plot. If the
generator is null
, no tool tips will be created.
null
).Returns the URL generator.
null
).Initialises the drawing procedure. This method will be called before the first item is rendered, giving the plot an opportunity to initialise any state information it wants to maintain.
g2 | the graphics device. |
---|---|
plotArea | the plot area (null not permitted). |
plot | the plot. |
index | the secondary index (null for primary
renderer). |
info | collects chart rendering information for return to caller. |
Returns a flag indicating whether the pie chart is circular, or stretched into an elliptical shape.
Sets the flag that controls whether or not the section outline paint is
auto-populated by the lookupSectionOutlinePaint(Comparable)
method, and sends a PlotChangeEvent
to all registered listeners.
auto | auto-populate? |
---|
Sets the flag that controls whether or not the section outline stroke is
auto-populated by the lookupSectionOutlineStroke(Comparable)
method, and sends a PlotChangeEvent
to all registered listeners.
auto | auto-populate? |
---|
Sets the flag that controls whether or not the section paint is
auto-populated by the lookupSectionPaint(Comparable)
method,
and sends a PlotChangeEvent
to all registered listeners.
auto | auto-populate? |
---|
Sets the base section paint.
paint | the paint (null not permitted). |
---|
Sets the base section stroke.
stroke | the stroke (null not permitted). |
---|
Sets the base section paint and sends a PlotChangeEvent
to all
registered listeners.
paint | the paint (null not permitted). |
---|
A flag indicating whether the pie chart is circular, or stretched into an elliptical shape.
flag | the new value. |
---|
Sets the circular attribute and, if requested, sends a
PlotChangeEvent
to all registered listeners.
circular | the new value of the flag. |
---|---|
notify | notify listeners? |
Sets the dataset and sends a DatasetChangeEvent
to 'this'.
dataset | the dataset (null permitted). |
---|
Sets the direction in which the pie sections are drawn and sends a
PlotChangeEvent
to all registered listeners.
direction | the direction (null not permitted). |
---|
Sets the amount that a pie section should be exploded and sends a
PlotChangeEvent
to all registered listeners.
key | the section key (null not permitted). |
---|---|
percent | the explode percentage (0.30 = 30 percent). |
This method is deprecated.
Use setExplodePercent(Comparable, double)
instead.
Sets the amount that a pie section should be exploded and sends a
PlotChangeEvent
to all registered listeners.
section | the section index. |
---|---|
percent | the explode percentage (0.30 = 30 percent). |
Sets a flag that controls whether null
values are ignored,
and sends a PlotChangeEvent
to all registered listeners. At
present, this only affects whether or not the key is presented in the
legend.
flag | the flag. |
---|
Sets a flag that controls whether zero values are ignored,
and sends a PlotChangeEvent
to all registered listeners. This
only affects whether or not a label appears for the non-visible
pie section.
flag | the flag. |
---|
Sets the interior gap and sends a PlotChangeEvent
to all
registered listeners. This controls the space between the edges of the
pie plot and the plot area itself (the region where the section labels
appear).
percent | the gap (as a percentage of the available drawing space). |
---|
Sets the section label background paint and sends a
PlotChangeEvent
to all registered listeners.
paint | the paint (null permitted). |
---|
Sets the label distributor and sends a PlotChangeEvent
to all
registered listeners.
distributor | the distributor (null not permitted). |
---|
Sets the section label font and sends a PlotChangeEvent
to all
registered listeners.
font | the font (null not permitted). |
---|
Sets the gap between the edge of the pie and the labels (expressed as a
percentage of the plot width) and sends a PlotChangeEvent
to all
registered listeners.
gap | the gap (a percentage, where 0.05 = five percent). |
---|
Sets the section label generator and sends a PlotChangeEvent
to
all registered listeners.
generator | the generator (null permitted). |
---|
Sets the link margin and sends a PlotChangeEvent
to all
registered listeners.
margin | the margin. |
---|
Sets the paint used for the lines that connect pie sections to their
corresponding labels, and sends a PlotChangeEvent
to all
registered listeners.
paint | the paint (null not permitted). |
---|
Sets the link stroke and sends a PlotChangeEvent
to all
registered listeners.
stroke | the stroke. |
---|
Sets the label link style and sends a PlotChangeEvent
to all
registered listeners.
style | the new style (null not permitted). |
---|
Sets the flag that controls whether or not label linking lines are
visible and sends a PlotChangeEvent
to all registered listeners.
Please take care when hiding the linking lines - depending on the data
values, the labels can be displayed some distance away from the
corresponding pie section.
visible | the flag. |
---|
Sets the section label outline paint and sends a
PlotChangeEvent
to all registered listeners.
paint | the paint (null permitted). |
---|
Sets the section label outline stroke and sends a
PlotChangeEvent
to all registered listeners.
stroke | the stroke (null permitted). |
---|
Sets the padding between each label and its outline and sends a
PlotChangeEvent
to all registered listeners.
padding | the padding (null not permitted). |
---|
Sets the section label paint and sends a PlotChangeEvent
to all
registered listeners.
paint | the paint (null not permitted). |
---|
Sets the section label shadow paint and sends a PlotChangeEvent
to all registered listeners.
paint | the paint (null permitted). |
---|
Sets the shape used for legend items and sends a PlotChangeEvent
to all registered listeners.
shape | the shape (null not permitted). |
---|
Sets the legend label generator and sends a PlotChangeEvent
to
all registered listeners.
generator | the generator (null not permitted). |
---|
Sets the legend label tool tip generator and sends a
PlotChangeEvent
to all registered listeners.
generator | the generator (null permitted). |
---|
Sets the legend label URL generator and sends a
PlotChangeEvent
to all registered listeners.
generator | the generator (null permitted). |
---|
Sets the maximum label width as a percentage of the plot width and sends
a PlotChangeEvent
to all registered listeners.
width | the width (a percentage, where 0.20 = 20 percent). |
---|
Sets the minimum arc angle that will be drawn. Pie sections for an
angle smaller than this are not drawn, to avoid a JDK bug. See this
link for details:
http://www.jfree.org/phpBB2/viewtopic.php?t=2707
...and this bug report in the Java Bug Parade:
http://developer.java.sun.com/developer/bugParade/bugs/4836495.html
angle | the minimum angle. |
---|
Sets the pie index (this is used by the MultiplePiePlot
class to
track subplots).
index | the index. |
---|
This method is deprecated.
Use setSectionOutlinePaint(Comparable, Paint)
instead.
Sets the paint used to fill a section of the pie and sends a
PlotChangeEvent
to all registered listeners.
section | the section index (zero-based). |
---|---|
paint | the paint (null permitted). |
Sets the outline paint associated with the specified key, and sends a
PlotChangeEvent
to all registered listeners.
key | the key (null not permitted). |
---|---|
paint | the paint. |
IllegalArgumentException | if key is
null . |
---|
This method is deprecated.
Use setSectionOutlinePaint(Comparable, Paint)
and
setBaseSectionOutlinePaint(Paint)
. Deprecated as of
version 1.0.6.
Sets the outline paint for ALL sections in the plot. If this is set to null, then a list of paints is used instead (to allow different colors to be used for each section).
paint | the paint (null permitted). |
---|
Sets the outline stroke associated with the specified key, and sends a
PlotChangeEvent
to all registered listeners.
key | the key (null not permitted). |
---|---|
stroke | the stroke. |
IllegalArgumentException | if key is
null . |
---|
This method is deprecated.
Use setSectionOutlineStroke(Comparable, Stroke)
instead.
Sets the stroke used to fill a section of the pie and sends a
PlotChangeEvent
to all registered listeners.
section | the section index (zero-based). |
---|---|
stroke | the stroke (null permitted). |
This method is deprecated.
Use setSectionOutlineStroke(Comparable, Stroke)
and
setBaseSectionOutlineStroke(Stroke)
. Deprecated as of
version 1.0.6.
Sets the outline stroke for ALL sections in the plot. If this is set to null, then a list of paints is used instead (to allow different colors to be used for each section).
stroke | the stroke (null permitted). |
---|
Sets the flag that controls whether or not the outline is drawn for
each pie section, and sends a PlotChangeEvent
to all registered
listeners.
visible | the flag. |
---|
Sets the paint associated with the specified key, and sends a
PlotChangeEvent
to all registered listeners.
key | the key (null not permitted). |
---|---|
paint | the paint. |
IllegalArgumentException | if key is
null . |
---|
This method is deprecated.
Use setSectionPaint(Comparable, Paint)
and
setBaseSectionPaint(Paint)
. Deprecated as of version 1.0.6.
Sets the paint for ALL sections in the plot. If this is set to null, then a list of paints is used instead (to allow different colors to be used for each section).
paint | the paint (null permitted). |
---|
This method is deprecated.
Use setSectionPaint(Comparable, Paint)
instead.
Sets the paint used to fill a section of the pie and sends a
PlotChangeEvent
to all registered listeners.
section | the section index (zero-based). |
---|---|
paint | the paint (null permitted). |
Sets the shadow paint and sends a PlotChangeEvent
to all
registered listeners.
paint | the paint (null permitted). |
---|
Sets the x-offset for the shadow effect and sends a
PlotChangeEvent
to all registered listeners.
offset | the offset (in Java2D units). |
---|
Sets the y-offset for the shadow effect and sends a
PlotChangeEvent
to all registered listeners.
offset | the offset (in Java2D units). |
---|
Sets the offset for the simple labels and sends a
PlotChangeEvent
to all registered listeners.
offset | the offset (null not permitted). |
---|
Sets the flag that controls whether simple or extended labels are
displayed on the plot, and sends a PlotChangeEvent
to all
registered listeners.
simple | the new flag value. |
---|
Sets the starting angle and sends a PlotChangeEvent
to all
registered listeners. The initial default value is 90 degrees, which
corresponds to 12 o'clock. A value of zero corresponds to 3 o'clock...
this is the encoding used by Java's Arc2D class.
angle | the angle (in degrees). |
---|
Sets the tool tip generator and sends a PlotChangeEvent
to all
registered listeners. Set the generator to null
if you
don't want any tool tips.
generator | the generator (null permitted). |
---|
Sets the URL generator and sends a PlotChangeEvent
to all
registered listeners.
generator | the generator (null permitted). |
---|
Draws a single data item.
g2 | the graphics device (null not permitted). |
---|---|
section | the section index. |
dataArea | the data plot area. |
state | state information for one chart. |
currentPass | the current pass index. |
Draws the labels for the pie sections.
g2 | the graphics device. |
---|---|
keys | the keys. |
totalValue | the total value. |
plotArea | the plot area. |
linkArea | the link area. |
state | the state. |
Draws a section label on the left side of the pie chart.
g2 | the graphics device. |
---|---|
state | the state. |
record | the label record. |
Draws the left labels.
leftKeys | a collection of keys and angles (to the middle of the section, in degrees) for the sections on the left side of the plot. |
---|---|
g2 | the graphics device. |
plotArea | the plot area. |
linkArea | the link area. |
maxLabelWidth | the maximum label width. |
state | the state. |
Draws the pie.
g2 | the graphics device. |
---|---|
plotArea | the plot area. |
info | chart rendering info. |
Draws a section label on the right side of the pie chart.
g2 | the graphics device. |
---|---|
state | the state. |
record | the label record. |
Draws the right labels.
keys | the keys. |
---|---|
g2 | the graphics device. |
plotArea | the plot area. |
linkArea | the link area. |
maxLabelWidth | the maximum label width. |
state | the state. |
Draws the pie section labels in the simple form.
g2 | the graphics device. |
---|---|
keys | the section keys. |
totalValue | the total value for all sections in the pie. |
plotArea | the plot area. |
pieArea | the area containing the pie. |
state | the plot state. |
Returns a rectangle that can be used to create a pie section (taking into account the amount by which the pie section is 'exploded').
unexploded | the area inside which the unexploded pie sections are drawn. |
---|---|
exploded | the area inside which the exploded pie sections are drawn. |
angle | the start angle. |
extent | the extent of the arc. |
explodePercent | the amount by which the pie section is exploded. |
Returns the distance that the end of the label link is embedded into
the plot, expressed as a percentage of the plot's radius.
This method is overridden in the RingPlot
class to resolve
bug 2121818.
0.10
.Returns a key for the specified section. If there is no such section in the dataset, we generate a key. This is to provide some backward compatibility for the (now deprecated) methods that get/set attributes based on section indices. The preferred way of doing this now is to link the attributes directly to the section key (there are new methods for this, starting from version 1.0.3).
section | the section index. |
---|
Returns the outline paint for the specified section. This is equivalent
to lookupSectionPaint(section,
getAutoPopulateSectionOutlinePaint())
.
key | the section key. |
---|
Returns the outline paint for the specified section. The lookup involves these steps:
getSectionOutlinePaint()
is non-null
,
return it;getSectionOutlinePaint(int)
is
non-null
return it;getSectionOutlinePaint(int)
is null
but
autoPopulate
is true
, attempt to fetch
a new outline paint from the drawing supplier
(getDrawingSupplier()
);
getBaseSectionOutlinePaint()
.
key | the section key. |
---|---|
autoPopulate | a flag that controls whether the drawing supplier is used to auto-populate the section outline paint settings. |
Returns the outline stroke for the specified section. This is
equivalent to lookupSectionOutlineStroke(section,
getAutoPopulateSectionOutlineStroke())
.
key | the section key. |
---|
Returns the outline stroke for the specified section. The lookup involves these steps:
getSectionOutlineStroke()
is non-null
,
return it;getSectionOutlineStroke(int)
is
non-null
return it;getSectionOutlineStroke(int)
is null
but
autoPopulate
is true
, attempt to fetch
a new outline stroke from the drawing supplier
(getDrawingSupplier()
);
getBaseSectionOutlineStroke()
.
key | the section key. |
---|---|
autoPopulate | a flag that controls whether the drawing supplier is used to auto-populate the section outline stroke settings. |
Returns the paint for the specified section. The lookup involves these steps:
getSectionPaint()
is non-null
, return
it;getSectionPaint(int)
is non-null
return
it;getSectionPaint(int)
is null
but
autoPopulate
is true
, attempt to fetch
a new paint from the drawing supplier
(getDrawingSupplier()
);
getBaseSectionPaint()
.
key | the section key. |
---|---|
autoPopulate | a flag that controls whether the drawing supplier is used to auto-populate the section paint settings. |
Returns the paint for the specified section. This is equivalent to
lookupSectionPaint(section, getAutoPopulateSectionPaint())
.
key | the section key. |
---|