public class XYBoxAndWhiskerRenderer extends AbstractXYItemRenderer implements XYItemRenderer, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
XYPlot
. This
renderer requires a BoxAndWhiskerXYDataset
). The example shown here
is generated by the BoxAndWhiskerChartDemo2.java
program
included in the JFreeChart demo collection:
This renderer does not include any code to calculate the crosshair point.
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO
Constructor and Description |
---|
XYBoxAndWhiskerRenderer()
Creates a new renderer for box and whisker charts.
|
XYBoxAndWhiskerRenderer(double boxWidth)
Creates a new renderer for box and whisker charts.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a clone of the renderer.
|
protected void |
drawEllipse(java.awt.geom.Point2D point,
double oRadius,
java.awt.Graphics2D g2)
Draws an ellipse to represent an outlier.
|
protected void |
drawHighFarOut(double aRadius,
java.awt.Graphics2D g2,
double xx,
double m)
Draws a triangle to indicate the presence of far out values.
|
void |
drawHorizontalItem(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState,
int pass)
Draws the visual representation of a single data item.
|
void |
drawItem(java.awt.Graphics2D g2,
XYItemRendererState state,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState,
int pass)
Draws the visual representation of a single data item.
|
protected void |
drawLowFarOut(double aRadius,
java.awt.Graphics2D g2,
double xx,
double m)
Draws a triangle to indicate the presence of far out values.
|
protected void |
drawMultipleEllipse(java.awt.geom.Point2D point,
double boxWidth,
double oRadius,
java.awt.Graphics2D g2)
Draws two ellipses to represent overlapping outliers.
|
void |
drawVerticalItem(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState,
int pass)
Draws the visual representation of a single data item.
|
boolean |
equals(java.lang.Object obj)
Tests this renderer for equality with another object.
|
Range |
findRangeBounds(XYDataset dataset)
Returns the range of values the renderer requires to display all the
items from the specified dataset.
|
java.awt.Paint |
getArtifactPaint()
Returns the paint used to paint the various artifacts such as outliers,
farout symbol, median line and the averages ellipse.
|
java.awt.Paint |
getBoxPaint()
Returns the paint used to fill boxes.
|
double |
getBoxWidth()
Returns the width of each box.
|
boolean |
getFillBox()
Returns the flag that controls whether or not the box is filled.
|
protected java.awt.Paint |
lookupBoxPaint(int series,
int item)
Returns the box paint or, if this is
null , the item
paint. |
void |
setArtifactPaint(java.awt.Paint paint)
Sets the paint used to paint the various artifacts such as outliers,
farout symbol, median line and the averages ellipse, and sends a
RendererChangeEvent to all registered listeners. |
void |
setBoxPaint(java.awt.Paint paint)
Sets the paint used to fill boxes and sends a
RendererChangeEvent
to all registered listeners. |
void |
setBoxWidth(double width)
Sets the box width and sends a
RendererChangeEvent to all
registered listeners. |
void |
setFillBox(boolean flag)
Sets the flag that controls whether or not the box is filled and sends a
RendererChangeEvent to all registered listeners. |
addAnnotation, addAnnotation, addEntity, annotationChanged, calculateDomainMarkerTextAnchorPoint, drawAnnotations, drawDomainGridLine, drawDomainLine, drawDomainMarker, drawItemLabel, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, findDomainBounds, findDomainBounds, findRangeBounds, getAnnotations, getBaseItemLabelGenerator, getBaseToolTipGenerator, getDrawingSupplier, getItemLabelGenerator, getItemLabelGenerator, getLegendItem, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPassCount, getPlot, getSeriesItemLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, getURLGenerator, initialise, isPointInRect, lineTo, moveTo, removeAnnotation, removeAnnotations, setBaseItemLabelGenerator, setBaseToolTipGenerator, setItemLabelGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator, setURLGenerator, updateCrosshairValues, updateCrosshairValues
addChangeListener, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseLegendShape, getBaseLegendTextFont, getBaseLegendTextPaint, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getDataBoundsIncludesVisibleSeriesOnly, getDefaultEntityRadius, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, getTreatLegendShapeAsLine, hashCode, hasListener, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseLegendShape, setBaseLegendTextFont, setBaseLegendTextPaint, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setDataBoundsIncludesVisibleSeriesOnly, setDefaultEntityRadius, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLegendShape, setLegendTextFont, setLegendTextPaint, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setShape, setStroke, setStroke, setTreatLegendShapeAsLine
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAnnotation, addAnnotation, addChangeListener, drawAnnotations, drawDomainGridLine, drawDomainMarker, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, findDomainBounds, getBaseItemLabelFont, getBaseItemLabelGenerator, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getBaseToolTipGenerator, getItemLabelFont, getItemLabelFont, getItemLabelGenerator, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendItem, getLegendItemLabelGenerator, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPassCount, getPlot, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelFont, getSeriesItemLabelGenerator, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesToolTipGenerator, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, getToolTipGenerator, getURLGenerator, initialise, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeAnnotation, removeAnnotations, removeChangeListener, setBaseItemLabelFont, setBaseItemLabelGenerator, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseStroke, setBaseToolTipGenerator, setItemLabelFont, setItemLabelGenerator, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLegendItemLabelGenerator, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPlot, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelFont, setSeriesItemLabelGenerator, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setSeriesToolTipGenerator, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setStroke, setToolTipGenerator, setURLGenerator
getLegendItems
public XYBoxAndWhiskerRenderer()
public XYBoxAndWhiskerRenderer(double boxWidth)
Use -1 for the box width if you prefer the width to be calculated automatically.
boxWidth
- the box width.public double getBoxWidth()
setBoxWidth(double)
public void setBoxWidth(double width)
RendererChangeEvent
to all
registered listeners.
If you set the width to a negative value, the renderer will calculate the box width automatically based on the space available on the chart.
width
- the width.getBoxWidth()
public java.awt.Paint getBoxPaint()
null
).setBoxPaint(Paint)
public void setBoxPaint(java.awt.Paint paint)
RendererChangeEvent
to all registered listeners.paint
- the paint (null
permitted).getBoxPaint()
public boolean getFillBox()
setFillBox(boolean)
public void setFillBox(boolean flag)
RendererChangeEvent
to all registered listeners.flag
- the flag.setFillBox(boolean)
public java.awt.Paint getArtifactPaint()
null
).setArtifactPaint(Paint)
public void setArtifactPaint(java.awt.Paint paint)
RendererChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getArtifactPaint()
public Range findRangeBounds(XYDataset dataset)
findRangeBounds
in interface XYItemRenderer
findRangeBounds
in class AbstractXYItemRenderer
dataset
- the dataset (null
permitted).null
if the dataset is null
or empty).AbstractXYItemRenderer.findDomainBounds(XYDataset)
protected java.awt.Paint lookupBoxPaint(int series, int item)
null
, the item
paint.series
- the series index.item
- the item index.null
).public void drawItem(java.awt.Graphics2D g2, XYItemRendererState state, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
drawItem
in interface XYItemRenderer
g2
- the graphics device.state
- the renderer state.dataArea
- the area within which the plot is being drawn.info
- collects info about the drawing.plot
- the plot (can be used to obtain standard color
information etc).domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the dataset (must be an instance of
BoxAndWhiskerXYDataset
).series
- the series index (zero-based).item
- the item index (zero-based).crosshairState
- crosshair information for the plot
(null
permitted).pass
- the pass index.public void drawHorizontalItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
g2
- the graphics device.dataArea
- the area within which the plot is being drawn.info
- collects info about the drawing.plot
- the plot (can be used to obtain standard color
information etc).domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the dataset (must be an instance of
BoxAndWhiskerXYDataset
).series
- the series index (zero-based).item
- the item index (zero-based).crosshairState
- crosshair information for the plot
(null
permitted).pass
- the pass index.public void drawVerticalItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
g2
- the graphics device.dataArea
- the area within which the plot is being drawn.info
- collects info about the drawing.plot
- the plot (can be used to obtain standard color
information etc).domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the dataset (must be an instance of
BoxAndWhiskerXYDataset
).series
- the series index (zero-based).item
- the item index (zero-based).crosshairState
- crosshair information for the plot
(null
permitted).pass
- the pass index.protected void drawEllipse(java.awt.geom.Point2D point, double oRadius, java.awt.Graphics2D g2)
point
- the location.oRadius
- the radius.g2
- the graphics device.protected void drawMultipleEllipse(java.awt.geom.Point2D point, double boxWidth, double oRadius, java.awt.Graphics2D g2)
point
- the location.boxWidth
- the box width.oRadius
- the radius.g2
- the graphics device.protected void drawHighFarOut(double aRadius, java.awt.Graphics2D g2, double xx, double m)
aRadius
- the radius.g2
- the graphics device.xx
- the x value.m
- the max y value.protected void drawLowFarOut(double aRadius, java.awt.Graphics2D g2, double xx, double m)
aRadius
- the radius.g2
- the graphics device.xx
- the x value.m
- the min y value.public boolean equals(java.lang.Object obj)
equals
in class AbstractXYItemRenderer
obj
- the object (null
permitted).true
or false
.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class AbstractXYItemRenderer
java.lang.CloneNotSupportedException
- if the renderer cannot be cloned.