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 FontThe 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 TypeMethodDescriptionvoidAdds 3D objects representing the current data for the plot to the specified world.booleanTests this plot for equality with an arbitrary object.generateToolTipText(ItemKey itemKey) Returns the tool tip text for the specified data item, ornullif no tool tip is required.PieDataset3D<? extends Comparable> Returns the dataset.doublegetDepth()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.doubleReturns 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.intReturns the number of segments used when composing the 3D objects representing the pie chart.Returns the tool tip generator.inthashCode()voidreceive(ChartElementVisitor visitor) Receives a visitor.voidsetDataset(PieDataset3D<? extends Comparable> dataset) Sets the dataset and notifies registered listeners that the dataset has been updated.voidsetDepth(double depth) Sets the depth of the pie chart and sends a change event to all registered listeners.voidsetLegendLabelGenerator(PieLabelGenerator generator) Sets the object that creates legend labels for each section of the pie chart, and sends aPlot3DChangeEventto all registered listeners.voidsetRadius(double radius) Sets the radius of the pie chart and sends a change event to all registered listeners.voidsetSectionColors(Color... colors) Sets a new color source for the plot using the specified colors and sends aPlot3DChangeEventto all registered listeners.voidsetSectionColorSource(ColorSource source) Sets the color source and sends aPlot3DChangeEventto all registered listeners.voidSets the color source for the section labels and sends aPlot3DChangeEventto all registered listeners.voidsetSectionLabelFontSource(FontSource source) Sets the font source and sends aPlot3DChangeEventto all registered listeners.voidsetSectionLabelGenerator(PieLabelGenerator generator) Sets the object that creates labels for each section of the pie chart, and sends aPlot3DChangeEventto all registered listeners.voidsetSegmentCount(int count) Sets the number of segments used when composing the pie chart and sends aPlot3DChangeEventto all registered listeners.voidsetToolTipGenerator(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 (nullnot 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 (nullnot 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 aPlot3DChangeEventto all registered listeners.- Parameters:
source- the color source (nullnot permitted).
-
setSectionColors
Sets a new color source for the plot using the specified colors and sends aPlot3DChangeEventto all registered listeners. This is a convenience method that is equivalent tosetSectionColorSource(new StandardColorSource(colors)).- Parameters:
colors- one or more colors (nullnot 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 aPlot3DChangeEventto all registered listeners.- Parameters:
generator- the generator (nullnot 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 aPlot3DChangeEventto all registered listeners.- Parameters:
source- the source (nullnot permitted).
-
getSectionLabelColorSource
Returns the color source for section labels. The default value is an instance ofStandardColorSourcethat always returnsColor.BLACK.- Returns:
- The color source (never
null). - See Also:
-
setSectionLabelColorSource
Sets the color source for the section labels and sends aPlot3DChangeEventto 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 aPlot3DChangeEventto all registered listeners.- Parameters:
generator- the generator (nullnot 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 (nullpermitted).- 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:
getDimensionsin interfacePlot3D- Overrides:
getDimensionsin 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 aPlot3DChangeEventto 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:
getLegendInfoin 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 theChart3Dclass, 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 theChart3Dclass - 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:AbstractPlot3DReturns the tool tip text for the specified data item, ornullif no tool tip is required.- Specified by:
generateToolTipTextin interfacePlot3D- Specified by:
generateToolTipTextin classAbstractPlot3D- Parameters:
itemKey- the item key (nullnot 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:
receivein interfaceChartElement- Specified by:
receivein classAbstractPlot3D- Parameters:
visitor- the visitor (nullnot 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:
equalsin classAbstractPlot3D- Parameters:
obj- the object (nullnot permitted).- Returns:
- A boolean.
-
hashCode
-