- 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,PublicCloneable,ChartElement,AnnotationChangeListener,org.jfree.chart.legend.LegendItemSource,XYItemRenderer
public class XYErrorRenderer extends XYLineAndShapeRenderer
A line and shape renderer that can also display x and/or y-error values. This renderer expects anIntervalXYDataset, otherwise it reverts to the behaviour of the super class. The example shown here is generated by theXYErrorRendererDemo1.javaprogram included in the JFreeChart demo collection:

- See Also:
- Serialized Form
-
-
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_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO
-
-
Constructor Summary
Constructors Constructor Description XYErrorRenderer()Creates a newXYErrorRendererinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawItem(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.booleanequals(Object obj)Tests this instance for equality with an arbitrary object.RangefindDomainBounds(XYDataset dataset)Returns the range required by this renderer to display all the domain values in the specified dataset.RangefindRangeBounds(XYDataset dataset)Returns the range required by this renderer to display all the range values in the specified dataset.doublegetCapLength()Returns the length (in Java2D units) of the cap at the end of the error bars.booleangetDrawXError()Returns the flag that controls whether or not the renderer draws error bars for the x-values.booleangetDrawYError()Returns the flag that controls whether or not the renderer draws error bars for the y-values.PaintgetErrorPaint()Returns the paint used to draw the error bars.StrokegetErrorStroke()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, setUseOutlinePaint
-
Methods 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, updateCrosshairValues
-
Methods 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, 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, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, receive, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, 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, 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, setTreatLegendShapeAsLine
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.ChartElement
receive
-
Methods inherited from interface org.jfree.chart.renderer.xy.XYItemRenderer
addAnnotation, addAnnotation, addChangeListener, drawAnnotations, drawDomainLine, drawDomainMarker, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, getAnnotations, 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 Detail
-
XYErrorRenderer
public XYErrorRenderer()
Creates a newXYErrorRendererinstance.
-
-
Method Detail
-
getDrawXError
public boolean getDrawXError()
Returns the flag that controls whether or not the renderer draws error bars for the x-values.- Returns:
- A boolean.
- See Also:
setDrawXError(boolean)
-
setDrawXError
public void setDrawXError(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.- Parameters:
draw- the flag value.- See Also:
getDrawXError()
-
getDrawYError
public boolean getDrawYError()
Returns the flag that controls whether or not the renderer draws error bars for the y-values.- Returns:
- A boolean.
- See Also:
setDrawYError(boolean)
-
setDrawYError
public void setDrawYError(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.- Parameters:
draw- the flag value.- See Also:
getDrawYError()
-
getCapLength
public double getCapLength()
Returns the length (in Java2D units) of the cap at the end of the error bars.- Returns:
- The cap length.
- See Also:
setCapLength(double)
-
setCapLength
public void setCapLength(double length)
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:
getCapLength()
-
getErrorPaint
public Paint 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(Paint)
-
setErrorPaint
public void setErrorPaint(Paint paint)
Sets the paint used to draw the error bars and sends aRendererChangeEventto all registered listeners.- Parameters:
paint- the paint (nullpermitted).- See Also:
getErrorPaint()
-
getErrorStroke
public Stroke 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(Stroke)
-
setErrorStroke
public void setErrorStroke(Stroke stroke)
Sets the stroke used to draw the error bars and sends aRendererChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullpermitted).- See Also:
getErrorStroke()
-
findDomainBounds
public Range findDomainBounds(XYDataset dataset)
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:
AbstractXYItemRenderer.findRangeBounds(XYDataset)
-
findRangeBounds
public Range findRangeBounds(XYDataset dataset)
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:
AbstractXYItemRenderer.findDomainBounds(XYDataset)
-
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
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classXYLineAndShapeRenderer- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
-