Package org.jfree.chart.plot
Class PiePlot
java.lang.Object
org.jfree.chart.plot.Plot
org.jfree.chart.plot.PiePlot
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,AxisChangeListener,DatasetChangeListener
- Direct Known Subclasses:
PiePlot3D
public class PiePlot extends Plot implements Cloneable, Serializable
A plot that displays data in the form of a pie chart, using data from any
class that implements the
PieDataset interface.
Special notes:
- the default starting point is 12 o'clock and the pie sections proceed in a clockwise direction, but these settings can be changed;
- negative values in the dataset are ignored;
- there are utility methods for creating a
PieDatasetfrom aCategoryDataset;
- See Also:
Plot,PieDataset, Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_INTERIOR_GAPThe default interior gap.static PaintDEFAULT_LABEL_BACKGROUND_PAINTThe default section label background paint.static FontDEFAULT_LABEL_FONTThe default section label font.static PaintDEFAULT_LABEL_OUTLINE_PAINTThe default section label outline paint.static StrokeDEFAULT_LABEL_OUTLINE_STROKEThe default section label outline stroke.static PaintDEFAULT_LABEL_PAINTThe default section label paint.static PaintDEFAULT_LABEL_SHADOW_PAINTThe default section label shadow paint.static doubleDEFAULT_MINIMUM_ARC_ANGLE_TO_DRAWThe default minimum arc angle to draw.static doubleDEFAULT_START_ANGLEThe default starting angle for the pie chart.static doubleMAX_INTERIOR_GAPThe maximum interior gap (currently 40%).Fields inherited from class org.jfree.chart.plot.Plot
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO -
Constructor Summary
Constructors Constructor Description PiePlot()Creates a new plot.PiePlot(PieDataset dataset)Creates a plot that will draw a pie chart for the specified dataset. -
Method Summary
Modifier and Type Method Description Objectclone()Returns a clone of the plot.voiddraw(Graphics2D g2, Rectangle2D plotArea, PlotState parentState, PlotRenderingInfo info)Draws the plot on a Java 2D graphics device (such as the screen or a printer).booleanequals(Object obj)Tests this plot for equality with an arbitrary object.PaintgetBaseSectionOutlinePaint()Returns the base section paint.StrokegetBaseSectionOutlineStroke()Returns the base section stroke.PaintgetBaseSectionPaint()Returns the base section paint.PieDatasetgetDataset()Returns the dataset.org.jfree.util.RotationgetDirection()Returns the direction in which the pie sections are drawn (clockwise or anti-clockwise).doublegetExplodePercent(int section)Returns the amount that a section should be 'exploded'.booleangetIgnoreNullValues()Returns the flag that controls whethernullvalues in the dataset are ignored.doublegetInteriorGap()Returns the interior gap, measured as a percentage of the available drawing space.PaintgetLabelBackgroundPaint()Returns the section label background paint.FontgetLabelFont()Returns the section label font.doublegetLabelGap()Returns the gap between the edge of the pie and the labels, expressed as a percentage of the plot width.PieSectionLabelGeneratorgetLabelGenerator()Returns the section label generator.doublegetLabelLinkMargin()Returns the margin (expressed as a percentage of the width or height) between the edge of the pie and the link point.PaintgetLabelLinkPaint()Returns the paint used for the lines that connect pie sections to their corresponding labels.StrokegetLabelLinkStroke()Returns the stroke used for the label linking lines.PaintgetLabelOutlinePaint()Returns the section label outline paint.StrokegetLabelOutlineStroke()Returns the section label outline stroke.PaintgetLabelPaint()Returns the section label paint.PaintgetLabelShadowPaint()Returns the section label shadow paint.LegendItemCollectiongetLegendItems()Returns a collection of legend items for the pie chart.doublegetMaximumExplodePercent()Returns the maximum explode percent.doublegetMaximumLabelWidth()Returns the maximum label width as a percentage of the plot width.doublegetMinimumArcAngleToDraw()Returns the minimum arc angle that will be drawn.intgetPieIndex()Returns the pie index (this is used by theMultiplePiePlotclass to track subplots).StringgetPlotType()Returns a short string describing the type of plot.PaintgetSectionOutlinePaint()Returns the outline paint for ALL sections in the plot.PaintgetSectionOutlinePaint(int section)Returns the paint for the specified section.StrokegetSectionOutlineStroke()Returns the outline stroke for ALL sections in the plot.StrokegetSectionOutlineStroke(int section)Returns the stroke for the specified section.PaintgetSectionPaint()Returns the paint for ALL sections in the plot.PaintgetSectionPaint(int section)Returns the paint for the specified section.PaintgetShadowPaint()Returns the shadow paint.doublegetShadowXOffset()Returns the x-offset for the shadow effect.doublegetShadowYOffset()Returns the y-offset for the shadow effect.doublegetStartAngle()Returns the start angle for the first pie section.PieToolTipGeneratorgetToolTipGenerator()Returns the tool tip generator, an object that is responsible for generating the text items used for tool tips by the plot.PieURLGeneratorgetURLGenerator()Returns the URL generator.PiePlotStateinitialise(Graphics2D g2, Rectangle2D plotArea, PiePlot plot, Integer index, PlotRenderingInfo info)Initialises the drawing procedure.booleanisCircular()Returns a flag indicating whether the pie chart is circular, or stretched into an elliptical shape.voidsetBaseSectionOutlinePaint(Paint paint)Sets the base section paint.voidsetBaseSectionOutlineStroke(Stroke stroke)Sets the base section stroke.voidsetBaseSectionPaint(Paint paint)Sets the base section paint.voidsetCircular(boolean flag)A flag indicating whether the pie chart is circular, or stretched into an elliptical shape.voidsetCircular(boolean circular, boolean notify)Sets the circular attribute and, if requested, sends aPlotChangeEventto all registered listeners.voidsetDataset(PieDataset dataset)Sets the dataset and sends aDatasetChangeEventto 'this'.voidsetDirection(org.jfree.util.Rotation direction)Sets the direction in which the pie sections are drawn and sends aPlotChangeEventto all registered listeners.voidsetExplodePercent(int section, double percent)Sets the amount that a pie section should be exploded and sends aPlotChangeEventto all registered listeners.voidsetIgnoreNullValues(boolean flag)Sets a flag that controls whethernullvalues are ignored, and sends aPlotChangeEventto all registered listeners.voidsetInteriorGap(double percent)Sets the interior gap and sends aPlotChangeEventto all registered listeners.voidsetLabelBackgroundPaint(Paint paint)Sets the section label background paint and sends aPlotChangeEventto all registered listeners.voidsetLabelFont(Font font)Sets the section label font and sends aPlotChangeEventto all registered listeners.voidsetLabelGap(double gap)Sets the gap between the edge of the pie and the labels (expressed as a percentage of the plot width) and sends aPlotChangeEventto all registered listeners.voidsetLabelGenerator(PieSectionLabelGenerator generator)Sets the section label generator and sends aPlotChangeEventto all registered listeners.voidsetLabelLinkMargin(double margin)Sets the link margin and sends aPlotChangeEventto all registered listeners.voidsetLabelLinkPaint(Paint paint)Sets the paint used for the lines that connect pie sections to their corresponding labels, and sends aPlotChangeEventto all registered listeners.voidsetLabelLinkStroke(Stroke stroke)Sets the link stroke and sends aPlotChangeEventto all registered listeners.voidsetLabelOutlinePaint(Paint paint)Sets the section label outline paint and sends aPlotChangeEventto all registered listeners.voidsetLabelOutlineStroke(Stroke stroke)Sets the section label outline stroke and sends aPlotChangeEventto all registered listeners.voidsetLabelPaint(Paint paint)Sets the section label paint and sends aPlotChangeEventto all registered listeners.voidsetLabelShadowPaint(Paint paint)Sets the section label shadow paint and sends aPlotChangeEventto all registered listeners.voidsetMaximumLabelWidth(double width)Sets the maximum label width as a percentage of the plot width and sends aPlotChangeEventto all registered listeners.voidsetMinimumArcAngleToDraw(double angle)Sets the minimum arc angle that will be drawn.voidsetPieIndex(int index)Sets the pie index (this is used by theMultiplePiePlotclass to track subplots).voidsetSectionOutlinePaint(int section, Paint paint)Sets the paint used to fill a section of the pie and sends aPlotChangeEventto all registered listeners.voidsetSectionOutlinePaint(Paint paint)Sets the outline paint for ALL sections in the plot.voidsetSectionOutlineStroke(int section, Stroke stroke)Sets the stroke used to fill a section of the pie and sends aPlotChangeEventto all registered listeners.voidsetSectionOutlineStroke(Stroke stroke)Sets the outline stroke for ALL sections in the plot.voidsetSectionPaint(int section, Paint paint)Sets the paint used to fill a section of the pie and sends aPlotChangeEventto all registered listeners.voidsetSectionPaint(Paint paint)Sets the paint for ALL sections in the plot.voidsetShadowPaint(Paint paint)Sets the shadow paint and sends aPlotChangeEventto all registered listeners.voidsetShadowXOffset(double offset)Sets the x-offset for the shadow effect and sends aPlotChangeEventto all registered listeners.voidsetShadowYOffset(double offset)Sets the y-offset for the shadow effect and sends aPlotChangeEventto all registered listeners.voidsetStartAngle(double angle)Sets the starting angle and sends aPlotChangeEventto all registered listeners.voidsetToolTipGenerator(PieToolTipGenerator generator)Sets the tool tip generator and sends aPlotChangeEventto all registered listeners.voidsetURLGenerator(PieURLGenerator generator)Sets the URL generator and sends aPlotChangeEventto all registered listeners.voidzoom(double percent)A zoom method that does nothing.Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, axisChanged, datasetChanged, draw, drawBackground, drawOutline, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundPaint, getDataAreaRatio, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRootPlot, handleClick, isPlotShowing, isSubplot, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundPaint, setDataAreaRatio, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setOutlinePaint, setOutlineStroke, setParent, setPlotShowing
-
Field Details
-
DEFAULT_INTERIOR_GAP
public static final double DEFAULT_INTERIOR_GAPThe default interior gap.- See Also:
- Constant Field Values
-
MAX_INTERIOR_GAP
public static final double MAX_INTERIOR_GAPThe maximum interior gap (currently 40%).- See Also:
- Constant Field Values
-
DEFAULT_START_ANGLE
public static final double DEFAULT_START_ANGLEThe default starting angle for the pie chart.- See Also:
- Constant Field Values
-
DEFAULT_LABEL_FONT
The default section label font. -
DEFAULT_LABEL_PAINT
The default section label paint. -
DEFAULT_LABEL_BACKGROUND_PAINT
The default section label background paint. -
DEFAULT_LABEL_OUTLINE_PAINT
The default section label outline paint. -
DEFAULT_LABEL_OUTLINE_STROKE
The default section label outline stroke. -
DEFAULT_LABEL_SHADOW_PAINT
The default section label shadow paint. -
DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW
public static final double DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAWThe default minimum arc angle to draw.- See Also:
- Constant Field Values
-
-
Constructor Details
-
PiePlot
public PiePlot()Creates a new plot. The dataset is initially set tonull. -
PiePlot
Creates a plot that will draw a pie chart for the specified dataset.- Parameters:
dataset- the dataset (nullpermitted).
-
-
Method Details
-
getDataset
Returns the dataset.- Returns:
- The dataset (possibly
null).
-
setDataset
Sets the dataset and sends aDatasetChangeEventto 'this'.- Parameters:
dataset- the dataset (nullpermitted).
-
getPieIndex
public int getPieIndex()Returns the pie index (this is used by theMultiplePiePlotclass to track subplots).- Returns:
- the pie index.
-
setPieIndex
public void setPieIndex(int index)Sets the pie index (this is used by theMultiplePiePlotclass to track subplots).- Parameters:
index- the index.
-
getStartAngle
public double getStartAngle()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 start angle.
-
setStartAngle
public void setStartAngle(double angle)Sets the starting angle and sends aPlotChangeEventto 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.
- Parameters:
angle- the angle (in degrees).
-
getDirection
public org.jfree.util.Rotation getDirection()Returns the direction in which the pie sections are drawn (clockwise or anti-clockwise).- Returns:
- the direction (never
null).
-
setDirection
public void setDirection(org.jfree.util.Rotation direction)Sets the direction in which the pie sections are drawn and sends aPlotChangeEventto all registered listeners.- Parameters:
direction- the direction (nullnot permitted).
-
getInteriorGap
public double getInteriorGap()Returns the interior gap, measured as a percentage of the available drawing space.- Returns:
- the gap (as a percentage of the available drawing space).
-
setInteriorGap
public void setInteriorGap(double percent)Sets the interior gap and sends aPlotChangeEventto 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).- Parameters:
percent- the gap (as a percentage of the available drawing space).
-
isCircular
public boolean isCircular()Returns a flag indicating whether the pie chart is circular, or stretched into an elliptical shape.- Returns:
- a flag indicating whether the pie chart is circular.
-
setCircular
public void setCircular(boolean flag)A flag indicating whether the pie chart is circular, or stretched into an elliptical shape.- Parameters:
flag- the new value.
-
setCircular
public void setCircular(boolean circular, boolean notify)Sets the circular attribute and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
circular- the new value of the flag.notify- notify listeners?
-
getSectionPaint
Returns the paint for ALL sections in the plot.- Returns:
- the paint (possibly
null).
-
setSectionPaint
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).- Parameters:
paint- the paint (nullpermitted).
-
getSectionPaint
Returns the paint for the specified section.- Parameters:
section- the section index (zero-based).- Returns:
- the paint (never
null).
-
setSectionPaint
Sets the paint used to fill a section of the pie and sends aPlotChangeEventto all registered listeners.- Parameters:
section- the section index (zero-based).paint- the paint (nullpermitted).
-
getBaseSectionPaint
Returns the base section paint. This is used when no other paint is available.- Returns:
- the paint (never
null).
-
setBaseSectionPaint
Sets the base section paint.- Parameters:
paint- the paint (nullnot permitted).
-
getSectionOutlinePaint
Returns the outline paint for ALL sections in the plot.- Returns:
- the paint (possibly
null).
-
setSectionOutlinePaint
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).- Parameters:
paint- the paint (nullpermitted).
-
getSectionOutlinePaint
Returns the paint for the specified section.- Parameters:
section- the section index (zero-based).- Returns:
- the paint (never
null).
-
setSectionOutlinePaint
Sets the paint used to fill a section of the pie and sends aPlotChangeEventto all registered listeners.- Parameters:
section- the section index (zero-based).paint- the paint (nullpermitted).
-
getBaseSectionOutlinePaint
Returns the base section paint. This is used when no other paint is available.- Returns:
- the paint (never
null).
-
setBaseSectionOutlinePaint
Sets the base section paint.- Parameters:
paint- the paint (nullnot permitted).
-
getSectionOutlineStroke
Returns the outline stroke for ALL sections in the plot.- Returns:
- the stroke (possibly
null).
-
setSectionOutlineStroke
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).- Parameters:
stroke- the stroke (nullpermitted).
-
getSectionOutlineStroke
Returns the stroke for the specified section.- Parameters:
section- the section index (zero-based).- Returns:
- the stroke (never
null).
-
setSectionOutlineStroke
Sets the stroke used to fill a section of the pie and sends aPlotChangeEventto all registered listeners.- Parameters:
section- the section index (zero-based).stroke- the stroke (nullpermitted).
-
getBaseSectionOutlineStroke
Returns the base section stroke. This is used when no other stroke is available.- Returns:
- the stroke (never
null).
-
setBaseSectionOutlineStroke
Sets the base section stroke.- Parameters:
stroke- the stroke (nullnot permitted).
-
getShadowPaint
Returns the shadow paint.- Returns:
- the paint (possibly
null).
-
setShadowPaint
Sets the shadow paint and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullpermitted).
-
getShadowXOffset
public double getShadowXOffset()Returns the x-offset for the shadow effect.- Returns:
- the offset (in Java2D units).
-
setShadowXOffset
public void setShadowXOffset(double offset)Sets the x-offset for the shadow effect and sends aPlotChangeEventto all registered listeners.- Parameters:
offset- the offset (in Java2D units).
-
getShadowYOffset
public double getShadowYOffset()Returns the y-offset for the shadow effect.- Returns:
- the offset (in Java2D units).
-
setShadowYOffset
public void setShadowYOffset(double offset)Sets the y-offset for the shadow effect and sends aPlotChangeEventto all registered listeners.- Parameters:
offset- the offset (in Java2D units).
-
getExplodePercent
public double getExplodePercent(int section)Returns the amount that a section should be 'exploded'.- Parameters:
section- the section number.- Returns:
- the amount that a section should be 'exploded'.
-
setExplodePercent
public void setExplodePercent(int section, double percent)Sets the amount that a pie section should be exploded and sends aPlotChangeEventto all registered listeners.- Parameters:
section- the section index.percent- the explode percentage (0.30 = 30 percent).
-
getMaximumExplodePercent
public double getMaximumExplodePercent()Returns the maximum explode percent.- Returns:
- the percent.
-
getLabelGenerator
Returns the section label generator.- Returns:
- the generator (possibly
null).
-
setLabelGenerator
Sets the section label generator and sends aPlotChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).
-
getLabelGap
public double getLabelGap()Returns the gap between the edge of the pie and the labels, expressed as a percentage of the plot width.- Returns:
- the gap (a percentage, where 0.05 = five percent).
-
setLabelGap
public void setLabelGap(double gap)Sets the gap between the edge of the pie and the labels (expressed as a percentage of the plot width) and sends aPlotChangeEventto all registered listeners.- Parameters:
gap- the gap (a percentage, where 0.05 = five percent).
-
getMaximumLabelWidth
public double getMaximumLabelWidth()Returns the maximum label width as a percentage of the plot width.- Returns:
- the width (a percentage, where 0.20 = 20 percent).
-
setMaximumLabelWidth
public void setMaximumLabelWidth(double width)Sets the maximum label width as a percentage of the plot width and sends aPlotChangeEventto all registered listeners.- Parameters:
width- the width (a percentage, where 0.20 = 20 percent).
-
getLabelLinkMargin
public double getLabelLinkMargin()Returns the margin (expressed as a percentage of the width or height) between the edge of the pie and the link point.- Returns:
- The link margin (as a percentage, where 0.05 is five percent).
-
setLabelLinkMargin
public void setLabelLinkMargin(double margin)Sets the link margin and sends aPlotChangeEventto all registered listeners.- Parameters:
margin- the margin.
-
getLabelLinkPaint
Returns the paint used for the lines that connect pie sections to their corresponding labels.- Returns:
- The paint (never
null).
-
setLabelLinkPaint
Sets the paint used for the lines that connect pie sections to their corresponding labels, and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).
-
getLabelLinkStroke
Returns the stroke used for the label linking lines.- Returns:
- the stroke.
-
setLabelLinkStroke
Sets the link stroke and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke.
-
getLabelFont
Returns the section label font.- Returns:
- the font (never
null).
-
setLabelFont
Sets the section label font and sends aPlotChangeEventto all registered listeners.- Parameters:
font- the font (nullnot permitted).
-
getLabelPaint
Returns the section label paint.- Returns:
- the paint (never
null).
-
setLabelPaint
Sets the section label paint and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).
-
getLabelBackgroundPaint
Returns the section label background paint.- Returns:
- The paint (possibly
null).
-
setLabelBackgroundPaint
Sets the section label background paint and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullpermitted).
-
getLabelOutlinePaint
Returns the section label outline paint.- Returns:
- The paint (possibly
null).
-
setLabelOutlinePaint
Sets the section label outline paint and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullpermitted).
-
getLabelOutlineStroke
Returns the section label outline stroke.- Returns:
- The stroke (possibly
null).
-
setLabelOutlineStroke
Sets the section label outline stroke and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullpermitted).
-
getLabelShadowPaint
Returns the section label shadow paint.- Returns:
- The paint (possibly
null).
-
setLabelShadowPaint
Sets the section label shadow paint and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullpermitted).
-
getToolTipGenerator
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 isnull, no tool tips will be created.- Returns:
- The generator (possibly
null).
-
setToolTipGenerator
Sets the tool tip generator and sends aPlotChangeEventto all registered listeners. Set the generator tonullif you don't want any tool tips.- Parameters:
generator- the generator (nullpermitted).
-
getURLGenerator
Returns the URL generator.- Returns:
- the generator (possibly
null).
-
setURLGenerator
Sets the URL generator and sends aPlotChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).
-
getMinimumArcAngleToDraw
public double getMinimumArcAngleToDraw()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 minimum angle.
-
setMinimumArcAngleToDraw
public void setMinimumArcAngleToDraw(double angle)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- Parameters:
angle- the minimum angle.
-
getIgnoreNullValues
public boolean getIgnoreNullValues()Returns the flag that controls whethernullvalues in the dataset are ignored.- Returns:
- A boolean.
-
setIgnoreNullValues
public void setIgnoreNullValues(boolean flag)Sets a flag that controls whethernullvalues are ignored, and sends aPlotChangeEventto all registered listeners. At present, this only affects whether or not the key is presented in the legend.- Parameters:
flag- the flag.
-
initialise
public PiePlotState initialise(Graphics2D g2, Rectangle2D plotArea, PiePlot plot, Integer index, PlotRenderingInfo info)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.- Parameters:
g2- the graphics device.plotArea- the plot area (nullnot permitted).plot- the plot.index- the secondary index (nullfor primary renderer).info- collects chart rendering information for return to caller.- Returns:
- A state object (maintains state information relevant to one chart drawing).
-
draw
public void draw(Graphics2D g2, Rectangle2D plotArea, 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.- Overrides:
getLegendItemsin classPlot- Returns:
- The legend items (never
null).
-
getPlotType
Returns a short string describing the type of plot.- Specified by:
getPlotTypein classPlot- Returns:
- the plot type.
-
zoom
public void zoom(double percent)A zoom method that does nothing.Plots are required to support the zoom operation. In the case of a pie chart, it doesn't make sense to zoom in or out, so the method is empty.
-
equals
Tests this plot for equality with an arbitrary object. Note that the plot's dataset is NOT included in the test for equality. -
clone
Returns a clone of the plot.- Overrides:
clonein classPlot- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if some component of the plot does not support cloning.
-