Class RingPlot
java.lang.Object
org.jfree.chart.plot.Plot
org.jfree.chart.plot.PiePlot
org.jfree.chart.plot.RingPlot
- All Implemented Interfaces:
Serializable, Cloneable, EventListener, AnnotationChangeListener, AxisChangeListener, MarkerChangeListener, LegendItemSource, DatasetChangeListener, org.jfree.util.PublicCloneable
A customised pie plot that leaves a hole in the middle.
- See Also:
-
Field Summary
Fields inherited from class PiePlot
DEFAULT_INTERIOR_GAP, DEFAULT_LABEL_BACKGROUND_PAINT, DEFAULT_LABEL_FONT, DEFAULT_LABEL_OUTLINE_PAINT, DEFAULT_LABEL_OUTLINE_STROKE, DEFAULT_LABEL_PAINT, DEFAULT_LABEL_SHADOW_PAINT, DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW, DEFAULT_START_ANGLE, localizationResources, MAX_INTERIOR_GAP -
Constructor Summary
ConstructorsConstructorDescriptionRingPlot()Creates a new plot with anulldataset.RingPlot(PieDataset dataset) Creates a new plot for the specified dataset. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawItem(Graphics2D g2, int section, Rectangle2D dataArea, PiePlotState state, int currentPass) Draws a single data item.booleanTests this plot for equality with an arbitrary object.doubleReturns the length of the inner extension of the separator line that is drawn between sections, expressed as a percentage of the depth of the section.protected doubleThis method overrides the default value for cases where the ring plot is very thin.doubleReturns the length of the outer extension of the separator line that is drawn between sections, expressed as a percentage of the depth of the section.doubleReturns the depth of each section, expressed as a percentage of the plot radius.Returns the separator paint.Returns the separator stroke.booleanReturns a flag that indicates whether or not separators are drawn between the sections in the chart.initialise(Graphics2D g2, Rectangle2D plotArea, PiePlot plot, Integer index, PlotRenderingInfo info) Initialises the plot state (which will store the total of all dataset values, among other things).voidsetInnerSeparatorExtension(double percent) Sets the length of the inner extension of the separator line that is drawn between sections, as a percentage of the depth of the sections, and sends aPlotChangeEventto all registered listeners.voidsetOuterSeparatorExtension(double percent) Sets the length of the outer extension of the separator line that is drawn between sections, as a percentage of the depth of the sections, and sends aPlotChangeEventto all registered listeners.voidsetSectionDepth(double sectionDepth) The section depth is given as percentage of the plot radius.voidsetSeparatorPaint(Paint paint) Sets the paint used to draw the separator between sections and sends aPlotChangeEventto all registered listeners.voidsetSeparatorStroke(Stroke stroke) Sets the stroke used to draw the separator between sections and sends aPlotChangeEventto all registered listeners.voidsetSeparatorsVisible(boolean visible) Sets the flag that controls whether or not separators are drawn between the sections in the chart, and sends aPlotChangeEventto all registered listeners.Methods inherited from class PiePlot
clearSectionOutlinePaints, clearSectionOutlineStrokes, clearSectionPaints, clone, draw, drawLabels, drawLeftLabel, drawLeftLabels, drawPie, drawRightLabel, drawRightLabels, drawSimpleLabels, getArcBounds, getArcCenter, getAutoPopulateSectionOutlinePaint, getAutoPopulateSectionOutlineStroke, getAutoPopulateSectionPaint, getBaseSectionOutlinePaint, getBaseSectionOutlineStroke, getBaseSectionPaint, getDataset, getDirection, getExplodePercent, getExplodePercent, getIgnoreNullValues, getIgnoreZeroValues, getInteriorGap, getLabelBackgroundPaint, getLabelDistributor, getLabelFont, getLabelGap, getLabelGenerator, getLabelLinkMargin, getLabelLinkPaint, getLabelLinkStroke, getLabelLinkStyle, getLabelLinksVisible, getLabelOutlinePaint, getLabelOutlineStroke, getLabelPadding, getLabelPaint, getLabelShadowPaint, getLegendItems, getLegendItemShape, getLegendLabelGenerator, getLegendLabelToolTipGenerator, getLegendLabelURLGenerator, getMaximumExplodePercent, getMaximumLabelWidth, getMinimumArcAngleToDraw, getPieIndex, getPlotType, getSectionKey, getSectionOutlinePaint, getSectionOutlinePaint, getSectionOutlinePaint, getSectionOutlineStroke, getSectionOutlineStroke, getSectionOutlineStroke, getSectionOutlinesVisible, getSectionPaint, getSectionPaint, getSectionPaint, getShadowGenerator, getShadowPaint, getShadowXOffset, getShadowYOffset, getSimpleLabelOffset, getSimpleLabels, getStartAngle, getToolTipGenerator, getURLGenerator, handleMouseWheelRotation, isCircular, lookupSectionOutlinePaint, lookupSectionOutlinePaint, lookupSectionOutlineStroke, lookupSectionOutlineStroke, lookupSectionPaint, lookupSectionPaint, lookupSectionPaint, setAutoPopulateSectionOutlinePaint, setAutoPopulateSectionOutlineStroke, setAutoPopulateSectionPaint, setBaseSectionOutlinePaint, setBaseSectionOutlineStroke, setBaseSectionPaint, setCircular, setCircular, setDataset, setDirection, setExplodePercent, setExplodePercent, setIgnoreNullValues, setIgnoreZeroValues, setInteriorGap, setLabelBackgroundPaint, setLabelDistributor, setLabelFont, setLabelGap, setLabelGenerator, setLabelLinkMargin, setLabelLinkPaint, setLabelLinkStroke, setLabelLinkStyle, setLabelLinksVisible, setLabelOutlinePaint, setLabelOutlineStroke, setLabelPadding, setLabelPaint, setLabelShadowPaint, setLegendItemShape, setLegendLabelGenerator, setLegendLabelToolTipGenerator, setLegendLabelURLGenerator, setMaximumLabelWidth, setMinimumArcAngleToDraw, setPieIndex, setSectionOutlinePaint, setSectionOutlinePaint, setSectionOutlinePaint, setSectionOutlineStroke, setSectionOutlineStroke, setSectionOutlineStroke, setSectionOutlinesVisible, setSectionPaint, setSectionPaint, setSectionPaint, setShadowGenerator, setShadowPaint, setShadowXOffset, setShadowYOffset, setSimpleLabelOffset, setSimpleLabels, setStartAngle, setToolTipGenerator, setURLGeneratorMethods inherited from class Plot
addChangeListener, annotationChanged, axisChanged, createAndAddEntity, datasetChanged, drawBackground, drawBackgroundImage, drawNoDataMessage, drawOutline, fillBackground, fillBackground, fireChangeEvent, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, handleClick, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setDatasetGroup, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent, zoom
-
Constructor Details
-
RingPlot
public RingPlot()Creates a new plot with anulldataset. -
RingPlot
Creates a new plot for the specified dataset.- Parameters:
dataset- the dataset (nullpermitted).
-
-
Method Details
-
getSeparatorsVisible
Returns a flag that indicates whether or not separators are drawn between the sections in the chart.- Returns:
- A boolean.
- See Also:
-
setSeparatorsVisible
Sets the flag that controls whether or not separators are drawn between the sections in the chart, and sends aPlotChangeEventto all registered listeners.- Parameters:
visible- the flag.- See Also:
-
getSeparatorStroke
Returns the separator stroke.- Returns:
- The stroke (never
null). - See Also:
-
setSeparatorStroke
Sets the stroke used to draw the separator between sections and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getSeparatorPaint
Returns the separator paint.- Returns:
- The paint (never
null). - See Also:
-
setSeparatorPaint
Sets the paint used to draw the separator between sections and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getInnerSeparatorExtension
Returns the length of the inner extension of the separator line that is drawn between sections, expressed as a percentage of the depth of the section.- Returns:
- The inner separator extension (as a percentage).
- See Also:
-
setInnerSeparatorExtension
Sets the length of the inner extension of the separator line that is drawn between sections, as a percentage of the depth of the sections, and sends aPlotChangeEventto all registered listeners.- Parameters:
percent- the percentage.- See Also:
-
getOuterSeparatorExtension
Returns the length of the outer extension of the separator line that is drawn between sections, expressed as a percentage of the depth of the section.- Returns:
- The outer separator extension (as a percentage).
- See Also:
-
setOuterSeparatorExtension
Sets the length of the outer extension of the separator line that is drawn between sections, as a percentage of the depth of the sections, and sends aPlotChangeEventto all registered listeners.- Parameters:
percent- the percentage.- See Also:
-
getSectionDepth
Returns the depth of each section, expressed as a percentage of the plot radius.- Returns:
- The depth of each section.
- Since:
- 1.0.3
- See Also:
-
setSectionDepth
The section depth is given as percentage of the plot radius. Specifying 1.0 results in a straightforward pie chart.- Parameters:
sectionDepth- the section depth.- Since:
- 1.0.3
- See Also:
-
initialise
public PiePlotState initialise(Graphics2D g2, Rectangle2D plotArea, PiePlot plot, Integer index, PlotRenderingInfo info) Initialises the plot state (which will store the total of all dataset values, among other things). This method is called once at the beginning of each drawing.- Overrides:
initialisein classPiePlot- 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).
-
drawItem
protected void drawItem(Graphics2D g2, int section, Rectangle2D dataArea, PiePlotState state, int currentPass) Draws a single data item. -
getLabelLinkDepth
This method overrides the default value for cases where the ring plot is very thin. This fixes bug 2121818.- Overrides:
getLabelLinkDepthin classPiePlot- Returns:
- The label link depth, as a percentage of the plot's radius.
-
equals
-