java.lang.Object
org.jfree.chart3d.plot.AbstractPlot3D
org.jfree.chart3d.plot.PiePlot3D
- All Implemented Interfaces:
Serializable
,EventListener
,ChartElement
,Dataset3DChangeListener
,Plot3D
A plot for creating 3D pie charts. To create a pie chart, you can use the
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
createPieChart()
method in the Chart3DFactory
class.
A typical pie chart will look like this:
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Font
The default font for section labels on the chart.Fields inherited from class org.jfree.chart3d.plot.AbstractPlot3D
autoAdjustDimensions, dimensions
-
Constructor Summary
ConstructorsConstructorDescriptionPiePlot3D
(PieDataset3D<? extends Comparable> dataset) Creates a new pie plot in 3D. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds 3D objects representing the current data for the plot to the specified world.boolean
Tests this plot for equality with an arbitrary object.generateToolTipText
(ItemKey itemKey) Returns the tool tip text for the specified data item, ornull
if no tool tip is required.PieDataset3D
<? extends Comparable> Returns the dataset.double
getDepth()
Returns the depth of the pie (the default value is 2.0).Returns the dimensions for the plot.getLabelFaces
(double xOffset, double yOffset, double zOffset) Returns a list of label faces for the plot.Returns a list containing legend item info, typically one item for each series in the chart.Returns the object that creates legend labels for each section of the pie chart.double
Returns the radius of the pie (the default value is 8.0).Returns the color source for section colors.Returns the color source for section labels.Returns the font source that is used to determine the font to use for the section labels.Returns the object that creates labels for each section of the pie chart.int
Returns the number of segments used when composing the 3D objects representing the pie chart.Returns the tool tip generator.int
hashCode()
void
receive
(ChartElementVisitor visitor) Receives a visitor.void
setDataset
(PieDataset3D<? extends Comparable> dataset) Sets the dataset and notifies registered listeners that the dataset has been updated.void
setDepth
(double depth) Sets the depth of the pie chart and sends a change event to all registered listeners.void
setLegendLabelGenerator
(PieLabelGenerator generator) Sets the object that creates legend labels for each section of the pie chart, and sends aPlot3DChangeEvent
to all registered listeners.void
setRadius
(double radius) Sets the radius of the pie chart and sends a change event to all registered listeners.void
setSectionColors
(Color... colors) Sets a new color source for the plot using the specified colors and sends aPlot3DChangeEvent
to all registered listeners.void
setSectionColorSource
(ColorSource source) Sets the color source and sends aPlot3DChangeEvent
to all registered listeners.void
Sets the color source for the section labels and sends aPlot3DChangeEvent
to all registered listeners.void
setSectionLabelFontSource
(FontSource source) Sets the font source and sends aPlot3DChangeEvent
to all registered listeners.void
setSectionLabelGenerator
(PieLabelGenerator generator) Sets the object that creates labels for each section of the pie chart, and sends aPlot3DChangeEvent
to all registered listeners.void
setSegmentCount
(int count) Sets the number of segments used when composing the pie chart and sends aPlot3DChangeEvent
to all registered listeners.void
setToolTipGenerator
(PieLabelGenerator generator) Sets the tool tip generator and sends a change event to all registered listeners.Methods inherited from class org.jfree.chart3d.plot.AbstractPlot3D
addChangeListener, datasetChanged, fireChangeEvent, getChart, isAutoAdjustDimensions, isNotify, notifyListeners, removeChangeListener, setChart, setNotify
-
Field Details
-
DEFAULT_SECTION_LABEL_FONT
The default font for section labels on the chart.
-
-
Constructor Details
-
PiePlot3D
Creates a new pie plot in 3D.- Parameters:
dataset
- the dataset (null
not permitted).
-
-
Method Details
-
getDataset
Returns the dataset.- Returns:
- The dataset (never
null
).
-
setDataset
Sets the dataset and notifies registered listeners that the dataset has been updated.- Parameters:
dataset
- the dataset (null
not permitted).
-
getRadius
Returns the radius of the pie (the default value is 8.0).- Returns:
- The radius of the pie.
-
setRadius
Sets the radius of the pie chart and sends a change event to all registered listeners.- Parameters:
radius
- the radius.
-
getDepth
Returns the depth of the pie (the default value is 2.0).- Returns:
- The depth of the pie.
-
setDepth
Sets the depth of the pie chart and sends a change event to all registered listeners.- Parameters:
depth
- the depth.
-
getSectionColorSource
Returns the color source for section colors.- Returns:
- The color source (never
null
).
-
setSectionColorSource
Sets the color source and sends aPlot3DChangeEvent
to all registered listeners.- Parameters:
source
- the color source (null
not permitted).
-
setSectionColors
Sets a new color source for the plot using the specified colors and sends aPlot3DChangeEvent
to all registered listeners. This is a convenience method that is equivalent tosetSectionColorSource(new StandardColorSource(colors))
.- Parameters:
colors
- one or more colors (null
not permitted).- Since:
- 1.2
-
getSectionLabelGenerator
Returns the object that creates labels for each section of the pie chart.- Returns:
- The section label generator (never
null
). - Since:
- 1.2
-
setSectionLabelGenerator
Sets the object that creates labels for each section of the pie chart, and sends aPlot3DChangeEvent
to all registered listeners.- Parameters:
generator
- the generator (null
not permitted).- Since:
- 1.2
-
getSectionLabelFontSource
Returns the font source that is used to determine the font to use for the section labels.- Returns:
- The font source for the section labels (never
null
).
-
setSectionLabelFontSource
Sets the font source and sends aPlot3DChangeEvent
to all registered listeners.- Parameters:
source
- the source (null
not permitted).
-
getSectionLabelColorSource
Returns the color source for section labels. The default value is an instance ofStandardColorSource
that always returnsColor.BLACK
.- Returns:
- The color source (never
null
). - See Also:
-
setSectionLabelColorSource
Sets the color source for the section labels and sends aPlot3DChangeEvent
to all registered listeners.- Parameters:
source
- the color source.- See Also:
-
getLegendLabelGenerator
Returns the object that creates legend labels for each section of the pie chart.- Returns:
- The legend label generator (never
null
). - Since:
- 1.2
-
setLegendLabelGenerator
Sets the object that creates legend labels for each section of the pie chart, and sends aPlot3DChangeEvent
to all registered listeners.- Parameters:
generator
- the generator (null
not permitted).- Since:
- 1.2
-
getToolTipGenerator
Returns the tool tip generator.- Returns:
- The tool tip generator (possibly
null
). - Since:
- 1.3
-
setToolTipGenerator
Sets the tool tip generator and sends a change event to all registered listeners.- Parameters:
generator
- the generator (null
permitted).- Since:
- 1.3
-
getDimensions
Returns the dimensions for the plot. For the pie chart, it is more natural to specify the dimensions in terms of a radius and a depth, so we use those values to calculate the dimensions here.- Specified by:
getDimensions
in interfacePlot3D
- Overrides:
getDimensions
in classAbstractPlot3D
- Returns:
- The dimensions for the plot.
- See Also:
-
getSegmentCount
Returns the number of segments used when composing the 3D objects representing the pie chart. The default value is40
.- Returns:
- The number of segments used to compose the pie chart.
-
setSegmentCount
Sets the number of segments used when composing the pie chart and sends aPlot3DChangeEvent
to all registered listeners. A higher number will result in a more rounded pie chart, but will take longer to render.- Parameters:
count
- the count.
-
getLegendInfo
Returns a list containing legend item info, typically one item for each series in the chart. This is intended for use in the construction of a chart legend.- Specified by:
getLegendInfo
in interfacePlot3D
- Returns:
- A list containing legend item info.
-
compose
Adds 3D objects representing the current data for the plot to the specified world. After the world has been populated (or constructed) in this way, it is ready for rendering. This method is called by theChart3D
class, you won't normally call it directly. -
getLabelFaces
Returns a list of label faces for the plot. These are non-visible objects added to the 3D model of the pie chart to track the positions for labels (which are added after the plot is projected and rendered).
NOTE: This method is public so that it can be called by theChart3D
class - you won't normally call it directly.- Parameters:
xOffset
- the x-offset.yOffset
- the y-offset.zOffset
- the z-offset.- Returns:
- A list of label faces.
-
generateToolTipText
Description copied from class:AbstractPlot3D
Returns the tool tip text for the specified data item, ornull
if no tool tip is required.- Specified by:
generateToolTipText
in interfacePlot3D
- Specified by:
generateToolTipText
in classAbstractPlot3D
- Parameters:
itemKey
- the item key (null
not permitted).- Returns:
- The tool tip text (possibly
null
).
-
receive
Receives a visitor. This is a general purpose mechanism, but the main use is to apply chart style changes across all the elements of a chart.- Specified by:
receive
in interfaceChartElement
- Specified by:
receive
in classAbstractPlot3D
- Parameters:
visitor
- the visitor (null
not permitted).- Since:
- 1.2
-
equals
Tests this plot for equality with an arbitrary object. Note that the plot's dataset is NOT considered in the equality test.- Overrides:
equals
in classAbstractPlot3D
- Parameters:
obj
- the object (null
not permitted).- Returns:
- A boolean.
-
hashCode
-