Package org.jfree.chart.plot
Class MultiplePiePlot
java.lang.Object
org.jfree.chart.plot.Plot
org.jfree.chart.plot.MultiplePiePlot
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,AnnotationChangeListener
,AxisChangeListener
,MarkerChangeListener
,LegendItemSource
,PublicCloneable
,DatasetChangeListener
A plot that displays multiple pie plots using data from a
CategoryDataset
.- See Also:
-
Field Summary
Fields inherited from class org.jfree.chart.plot.Plot
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_LEGEND_ITEM_BOX, DEFAULT_LEGEND_ITEM_CIRCLE, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO
-
Constructor Summary
ConstructorDescriptionCreates a new plot with no data.MultiplePiePlot
(CategoryDataset dataset) Creates a new plot. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of the plot.void
draw
(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info) Draws the plot on a Java 2D graphics device (such as the screen or a printer).boolean
Tests this plot for equality with an arbitrary object.Returns the key for aggregated items in the pie plots, if there are any.Returns the paint used to draw the pie section representing the aggregated items.Returns the data extract order (by row or by column).Returns the dataset used by the plot.Returns a collection of legend items for the pie chart.Returns the shape used for legend items.double
getLimit()
Returns the limit (as a percentage) below which small pie sections are aggregated.Returns the pie chart that is used to draw the individual pie plots.Returns a short string describing the type of plot.void
Sets the key for aggregated items in the pie plots.void
setAggregatedItemsPaint
(Paint paint) Sets the paint used to draw the pie section representing the aggregated items and sends aPlotChangeEvent
to all registered listeners.void
setDataExtractOrder
(TableOrder order) Sets the data extract order (by row or by column) and sends aPlotChangeEvent
to all registered listeners.void
setDataset
(CategoryDataset dataset) Sets the dataset used by the plot and sends aPlotChangeEvent
to all registered listeners.void
setLegendItemShape
(Shape shape) Sets the shape used for legend items and sends aPlotChangeEvent
to all registered listeners.void
setLimit
(double limit) Sets the limit below which pie sections are aggregated.void
setPieChart
(JFreeChart pieChart) Sets the chart that is used to draw the individual pie plots.Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, annotationChanged, axisChanged, canEqual, createAndAddEntity, datasetChanged, drawBackground, drawBackgroundImage, drawNoDataMessage, drawOutline, fetchElementHintingFlag, fillBackground, fillBackground, fireChangeEvent, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getChart, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, handleClick, hashCode, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setChart, setDatasetGroup, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent, zoom
-
Constructor Details
-
MultiplePiePlot
public MultiplePiePlot()Creates a new plot with no data. -
MultiplePiePlot
Creates a new plot.- Parameters:
dataset
- the dataset (null
permitted).
-
-
Method Details
-
getDataset
Returns the dataset used by the plot.- Returns:
- The dataset (possibly
null
).
-
setDataset
Sets the dataset used by the plot and sends aPlotChangeEvent
to all registered listeners.- Parameters:
dataset
- the dataset (null
permitted).
-
getPieChart
Returns the pie chart that is used to draw the individual pie plots. Note that there are some attributes on this chart instance that will be ignored at rendering time (for example, legend item settings).- Returns:
- The pie chart (never
null
). - See Also:
-
setPieChart
Sets the chart that is used to draw the individual pie plots. The chart's plot must be an instance ofPiePlot
.- Parameters:
pieChart
- the pie chart (null
not permitted).- See Also:
-
getDataExtractOrder
Returns the data extract order (by row or by column).- Returns:
- The data extract order (never
null
).
-
setDataExtractOrder
Sets the data extract order (by row or by column) and sends aPlotChangeEvent
to all registered listeners.- Parameters:
order
- the order (null
not permitted).
-
getLimit
Returns the limit (as a percentage) below which small pie sections are aggregated.- Returns:
- The limit percentage.
-
setLimit
Sets the limit below which pie sections are aggregated. Set this to 0.0 if you don't want any aggregation to occur.- Parameters:
limit
- the limit percent.
-
getAggregatedItemsKey
Returns the key for aggregated items in the pie plots, if there are any. The default value is "Other".- Returns:
- The aggregated items key.
-
setAggregatedItemsKey
Sets the key for aggregated items in the pie plots. You must ensure that this doesn't clash with any keys in the dataset.- Parameters:
key
- the key (null
not permitted).
-
getAggregatedItemsPaint
Returns the paint used to draw the pie section representing the aggregated items. The default value is {code Color.LIGHT_GRAY}.- Returns:
- The paint.
-
setAggregatedItemsPaint
Sets the paint used to draw the pie section representing the aggregated items and sends aPlotChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).
-
getPlotType
Returns a short string describing the type of plot.- Specified by:
getPlotType
in classPlot
- Returns:
- The plot type.
-
getLegendItemShape
Returns the shape used for legend items.- Returns:
- The shape (never
null
). - See Also:
-
setLegendItemShape
Sets the shape used for legend items and sends aPlotChangeEvent
to all registered listeners.- Parameters:
shape
- the shape (null
not permitted).- See Also:
-
draw
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info) Draws the plot on a Java 2D graphics device (such as the screen or a printer). -
getLegendItems
Returns a collection of legend items for the pie chart.- Specified by:
getLegendItems
in interfaceLegendItemSource
- Overrides:
getLegendItems
in classPlot
- Returns:
- The legend items.
-
equals
Tests this plot for equality with an arbitrary object. Note that the plot's dataset is not considered in the equality test. -
clone
Returns a clone of the plot.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classPlot
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if some component of the plot does not support cloning.
-