Package org.jfree.chart.renderer.xy
Class XYErrorRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.xy.AbstractXYItemRenderer
org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
org.jfree.chart.renderer.xy.XYErrorRenderer
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,AnnotationChangeListener,LegendItemSource,XYItemRenderer,PublicCloneable
A line and shape renderer that can also display x and/or y-error values.
This renderer expects an

IntervalXYDataset, otherwise it reverts
to the behaviour of the super class. The example shown here is generated by
the XYErrorRendererDemo1.java program included in the
JFreeChart demo collection:

- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
XYLineAndShapeRenderer.State -
Field Summary
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer
DEFAULT_ITEM_LABEL_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass) Draws the visual representation for one data item.booleanTests this instance for equality with an arbitrary object.findDomainBounds(XYDataset dataset) Returns the range required by this renderer to display all the domain values in the specified dataset.findRangeBounds(XYDataset dataset) Returns the range required by this renderer to display all the range values in the specified dataset.doubleReturns the length (in Java2D units) of the cap at the end of the error bars.booleanReturns the flag that controls whether or not the renderer draws error bars for the x-values.booleanReturns the flag that controls whether or not the renderer draws error bars for the y-values.Returns the paint used to draw the error bars.Returns the stroke used to draw the error bars.voidsetCapLength(double length) Sets the length of the cap at the end of the error bars, and sends aRendererChangeEventto all registered listeners.voidsetDrawXError(boolean draw) Sets the flag that controls whether or not the renderer draws error bars for the x-values and, if the flag changes, sends aRendererChangeEventto all registered listeners.voidsetDrawYError(boolean draw) Sets the flag that controls whether or not the renderer draws error bars for the y-values and, if the flag changes, sends aRendererChangeEventto all registered listeners.voidsetErrorPaint(Paint paint) Sets the paint used to draw the error bars and sends aRendererChangeEventto all registered listeners.voidsetErrorStroke(Stroke stroke) Sets the stroke used to draw the error bars and sends aRendererChangeEventto all registered listeners.Methods inherited from class org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
clone, drawFirstPassShape, drawPrimaryLine, drawPrimaryLineAsPath, drawSecondaryPass, getDefaultLinesVisible, getDefaultShapesFilled, getDefaultShapesVisible, getDrawOutlines, getDrawSeriesLineAsPath, getItemLineVisible, getItemShapeFilled, getItemShapeVisible, getLegendItem, getLegendLine, getPassCount, getSeriesLinesVisible, getSeriesShapesFilled, getSeriesShapesVisible, getUseFillPaint, getUseOutlinePaint, hashCode, initialise, isItemPass, isLinePass, setDefaultLinesVisible, setDefaultShapesFilled, setDefaultShapesVisible, setDrawOutlines, setDrawSeriesLineAsPath, setLegendLine, setSeriesLinesVisible, setSeriesLinesVisible, setSeriesShapesFilled, setSeriesShapesFilled, setSeriesShapesVisible, setSeriesShapesVisible, setUseFillPaint, setUseOutlinePaintMethods inherited from class org.jfree.chart.renderer.xy.AbstractXYItemRenderer
addAnnotation, addAnnotation, addEntity, annotationChanged, beginElementGroup, calculateDomainMarkerTextAnchorPoint, drawAnnotations, drawDomainLine, drawDomainMarker, drawItemLabel, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, findDomainBounds, findRangeBounds, getAnnotations, getDefaultItemLabelGenerator, getDefaultToolTipGenerator, getDrawingSupplier, getItemLabelGenerator, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPlot, getSeriesItemLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getURLGenerator, lineTo, moveTo, removeAnnotation, removeAnnotations, setDefaultItemLabelGenerator, setDefaultToolTipGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesToolTipGenerator, setURLGenerator, updateCrosshairValuesMethods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, beginElementGroup, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, endElementGroup, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getDataBoundsIncludesVisibleSeriesOnly, getDefaultCreateEntities, getDefaultEntityRadius, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultLegendShape, getDefaultLegendTextFont, getDefaultLegendTextPaint, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelInsets, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, getTreatLegendShapeAsLine, hasListener, isComputeItemLabelContrastColor, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setComputeItemLabelContrastColor, setDataBoundsIncludesVisibleSeriesOnly, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultEntityRadius, setDefaultFillPaint, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultLegendShape, setDefaultLegendTextFont, setDefaultLegendTextPaint, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setItemLabelAnchorOffset, setItemLabelInsets, setLegendShape, setLegendTextFont, setLegendTextPaint, 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, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setTreatLegendShapeAsLineMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart.LegendItemSource
getLegendItemsMethods inherited from interface org.jfree.chart.renderer.xy.XYItemRenderer
addAnnotation, addAnnotation, addChangeListener, drawAnnotations, drawDomainLine, drawDomainMarker, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, getDefaultCreateEntities, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelGenerator, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getDefaultToolTipGenerator, getItemCreateEntity, getItemFillPaint, getItemLabelFont, getItemLabelGenerator, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendItemLabelGenerator, getNegativeItemLabelPosition, getPlot, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelGenerator, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesToolTipGenerator, getSeriesVisible, getSeriesVisibleInLegend, getToolTipGenerator, getURLGenerator, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeAnnotation, removeAnnotations, removeChangeListener, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultFillPaint, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelGenerator, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setDefaultToolTipGenerator, setLegendItemLabelGenerator, setPlot, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelGenerator, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesToolTipGenerator, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setURLGenerator
-
Constructor Details
-
XYErrorRenderer
public XYErrorRenderer()Creates a newXYErrorRendererinstance.
-
-
Method Details
-
getDrawXError
Returns the flag that controls whether or not the renderer draws error bars for the x-values.- Returns:
- A boolean.
- See Also:
-
setDrawXError
Sets the flag that controls whether or not the renderer draws error bars for the x-values and, if the flag changes, sends aRendererChangeEventto all registered listeners.- Parameters:
draw- the flag value.- See Also:
-
getDrawYError
Returns the flag that controls whether or not the renderer draws error bars for the y-values.- Returns:
- A boolean.
- See Also:
-
setDrawYError
Sets the flag that controls whether or not the renderer draws error bars for the y-values and, if the flag changes, sends aRendererChangeEventto all registered listeners.- Parameters:
draw- the flag value.- See Also:
-
getCapLength
Returns the length (in Java2D units) of the cap at the end of the error bars.- Returns:
- The cap length.
- See Also:
-
setCapLength
Sets the length of the cap at the end of the error bars, and sends aRendererChangeEventto all registered listeners.- Parameters:
length- the length (in Java2D units).- See Also:
-
getErrorPaint
Returns the paint used to draw the error bars. If this isnull(the default), the item paint is used instead.- Returns:
- The paint (possibly
null). - See Also:
-
setErrorPaint
Sets the paint used to draw the error bars and sends aRendererChangeEventto all registered listeners.- Parameters:
paint- the paint (nullpermitted).- See Also:
-
getErrorStroke
Returns the stroke used to draw the error bars. If this isnull(the default), the item outline stroke is used instead.- Returns:
- The stroke (possibly
null). - See Also:
-
setErrorStroke
Sets the stroke used to draw the error bars and sends aRendererChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullpermitted).- See Also:
-
findDomainBounds
Returns the range required by this renderer to display all the domain values in the specified dataset.- Specified by:
findDomainBoundsin interfaceXYItemRenderer- Overrides:
findDomainBoundsin classAbstractXYItemRenderer- Parameters:
dataset- the dataset (nullpermitted).- Returns:
- The range, or
nullif the dataset isnull. - See Also:
-
findRangeBounds
Returns the range required by this renderer to display all the range values in the specified dataset.- Specified by:
findRangeBoundsin interfaceXYItemRenderer- Overrides:
findRangeBoundsin classAbstractXYItemRenderer- Parameters:
dataset- the dataset (nullpermitted).- Returns:
- The range, or
nullif the dataset isnull. - See Also:
-
drawItem
public void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass) Draws the visual representation for one data item.- Specified by:
drawItemin interfaceXYItemRenderer- Overrides:
drawItemin classXYLineAndShapeRenderer- Parameters:
g2- the graphics output target.state- the renderer state.dataArea- the data area.info- the plot rendering info.plot- the plot.domainAxis- the domain axis.rangeAxis- the range axis.dataset- the dataset.series- the series index.item- the item index.crosshairState- the crosshair state.pass- the pass index.
-
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classXYLineAndShapeRenderer- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-