org.jfree.chart.renderer.category
Class StatisticalBarRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
org.jfree.chart.renderer.category.BarRenderer
org.jfree.chart.renderer.category.StatisticalBarRenderer
- All Implemented Interfaces:
- Serializable, Cloneable, LegendItemSource, CategoryItemRenderer, org.jfree.util.PublicCloneable
public class StatisticalBarRenderer
- extends BarRenderer
- implements CategoryItemRenderer, Cloneable, org.jfree.util.PublicCloneable, Serializable
A renderer that handles the drawing a bar plot where
each bar has a mean value and a standard deviation line. The example shown
here is generated by the StatisticalBarChartDemo1.java
program
included in the JFreeChart Demo Collection:
- See Also:
- Serialized Form
Method Summary |
protected void |
drawHorizontalItem(Graphics2D g2,
CategoryItemRendererState state,
Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
StatisticalCategoryDataset dataset,
int visibleRow,
int row,
int column)
Draws an item for a plot with a horizontal orientation. |
void |
drawItem(Graphics2D g2,
CategoryItemRendererState state,
Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryDataset data,
int row,
int column,
int pass)
Draws the bar with its standard deviation line range for a single
(series, category) data item. |
protected void |
drawVerticalItem(Graphics2D g2,
CategoryItemRendererState state,
Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
StatisticalCategoryDataset dataset,
int visibleRow,
int row,
int column)
Draws an item for a plot with a vertical orientation. |
boolean |
equals(Object obj)
Tests this renderer for equality with an arbitrary object. |
Range |
findRangeBounds(CategoryDataset dataset)
Returns the range of values the renderer requires to display all the
items from the specified dataset. |
Paint |
getErrorIndicatorPaint()
Returns the paint used for the error indicators. |
Stroke |
getErrorIndicatorStroke()
Returns the stroke used to draw the error indicators. |
void |
setErrorIndicatorPaint(Paint paint)
Sets the paint used for the error indicators (if null ,
the item outline paint is used instead) and sends a
RendererChangeEvent to all registered listeners. |
void |
setErrorIndicatorStroke(Stroke stroke)
Sets the stroke used to draw the error indicators, and sends a
RendererChangeEvent to all registered listeners. |
Methods inherited from class org.jfree.chart.renderer.category.BarRenderer |
calculateBarL0L1, calculateBarW0, calculateBarWidth, calculateSeriesWidth, drawItemLabel, findRangeBounds, getBarPainter, getBase, getDefaultBarPainter, getDefaultShadowsVisible, getGradientPaintTransformer, getIncludeBaseInRange, getItemMargin, getLegendItem, getLowerClip, getMaximumBarWidth, getMinimumBarLength, getNegativeItemLabelPositionFallback, getPositiveItemLabelPositionFallback, getShadowPaint, getShadowsVisible, getShadowXOffset, getShadowYOffset, getUpperClip, initialise, isDrawBarOutline, setBarPainter, setBase, setDefaultBarPainter, setDefaultShadowsVisible, setDrawBarOutline, setGradientPaintTransformer, setIncludeBaseInRange, setItemMargin, setMaximumBarWidth, setMinimumBarLength, setNegativeItemLabelPositionFallback, setPositiveItemLabelPositionFallback, setShadowPaint, setShadowVisible, setShadowXOffset, setShadowYOffset |
Methods inherited from class org.jfree.chart.renderer.category.AbstractCategoryItemRenderer |
addEntity, addItemEntity, calculateDomainMarkerTextAnchorPoint, calculateRangeMarkerTextAnchorPoint, clone, createState, drawBackground, drawDomainGridline, drawDomainMarker, drawItemLabel, drawOutline, drawRangeGridline, drawRangeLine, drawRangeMarker, getBaseItemLabelGenerator, getBaseItemURLGenerator, getBaseToolTipGenerator, getColumnCount, getDomainAxis, getDrawingSupplier, getItemLabelGenerator, getItemMiddle, getItemURLGenerator, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPassCount, getPlot, getRangeAxis, getRowCount, getSeriesItemLabelGenerator, getSeriesItemURLGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, hashCode, setBaseItemLabelGenerator, setBaseItemURLGenerator, setBaseToolTipGenerator, setItemLabelGenerator, setItemURLGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesItemURLGenerator, setSeriesToolTipGenerator, setToolTipGenerator, updateCrosshairValues |
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer |
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, 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 |
Methods inherited from interface org.jfree.chart.renderer.category.CategoryItemRenderer |
addChangeListener, drawBackground, drawDomainGridline, drawDomainMarker, drawOutline, drawRangeGridline, drawRangeMarker, getBaseItemLabelFont, getBaseItemLabelGenerator, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseItemURLGenerator, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getBaseToolTipGenerator, getItemLabelFont, getItemLabelFont, getItemLabelGenerator, getItemLabelPaint, getItemLabelPaint, getItemMiddle, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemURLGenerator, getItemVisible, getLegendItem, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPassCount, getPlot, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelFont, getSeriesItemLabelGenerator, getSeriesItemLabelPaint, getSeriesItemURLGenerator, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesToolTipGenerator, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, getToolTipGenerator, getToolTipGenerator, initialise, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeChangeListener, setBaseItemLabelFont, setBaseItemLabelGenerator, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemURLGenerator, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseStroke, setBaseToolTipGenerator, setItemLabelFont, setItemLabelGenerator, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setItemURLGenerator, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPlot, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelFont, setSeriesItemLabelGenerator, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemURLGenerator, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setSeriesToolTipGenerator, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setStroke, setToolTipGenerator |
Methods inherited from interface org.jfree.util.PublicCloneable |
clone |
StatisticalBarRenderer
public StatisticalBarRenderer()
- Default constructor.
getErrorIndicatorPaint
public Paint getErrorIndicatorPaint()
- Returns the paint used for the error indicators.
- Returns:
- The paint used for the error indicators (possibly
null
). - See Also:
setErrorIndicatorPaint(Paint)
setErrorIndicatorPaint
public void setErrorIndicatorPaint(Paint paint)
- Sets the paint used for the error indicators (if
null
,
the item outline paint is used instead) and sends a
RendererChangeEvent
to all registered listeners.
- Parameters:
paint
- the paint (null
permitted).- See Also:
getErrorIndicatorPaint()
getErrorIndicatorStroke
public Stroke getErrorIndicatorStroke()
- Returns the stroke used to draw the error indicators. If this is
null
, the renderer will use the item outline stroke).
- Returns:
- The stroke (possibly
null
). - Since:
- 1.0.8
- See Also:
setErrorIndicatorStroke(Stroke)
setErrorIndicatorStroke
public void setErrorIndicatorStroke(Stroke stroke)
- Sets the stroke used to draw the error indicators, and sends a
RendererChangeEvent
to all registered listeners. If you set
this to null
, the renderer will use the item outline
stroke.
- Parameters:
stroke
- the stroke (null
permitted).- Since:
- 1.0.8
- See Also:
getErrorIndicatorStroke()
findRangeBounds
public Range findRangeBounds(CategoryDataset dataset)
- Returns the range of values the renderer requires to display all the
items from the specified dataset. This takes into account the range
between the min/max values, possibly ignoring invisible series.
- Specified by:
findRangeBounds
in interface CategoryItemRenderer
- Overrides:
findRangeBounds
in class AbstractCategoryItemRenderer
- Parameters:
dataset
- the dataset (null
permitted).
- Returns:
- The range (or
null
if the dataset is
null
or empty).
drawItem
public void drawItem(Graphics2D g2,
CategoryItemRendererState state,
Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryDataset data,
int row,
int column,
int pass)
- Draws the bar with its standard deviation line range for a single
(series, category) data item.
- Specified by:
drawItem
in interface CategoryItemRenderer
- Overrides:
drawItem
in class BarRenderer
- Parameters:
g2
- the graphics device.state
- the renderer state.dataArea
- the data area.plot
- the plot.domainAxis
- the domain axis.rangeAxis
- the range axis.data
- the data.row
- the row index (zero-based).column
- the column index (zero-based).pass
- the pass index.
drawHorizontalItem
protected void drawHorizontalItem(Graphics2D g2,
CategoryItemRendererState state,
Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
StatisticalCategoryDataset dataset,
int visibleRow,
int row,
int column)
- Draws an item for a plot with a horizontal orientation.
- Parameters:
g2
- the graphics device.state
- the renderer state.dataArea
- the data area.plot
- the plot.domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the data.visibleRow
- the visible row index.row
- the row index (zero-based).column
- the column index (zero-based).
drawVerticalItem
protected void drawVerticalItem(Graphics2D g2,
CategoryItemRendererState state,
Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
StatisticalCategoryDataset dataset,
int visibleRow,
int row,
int column)
- Draws an item for a plot with a vertical orientation.
- Parameters:
g2
- the graphics device.state
- the renderer state.dataArea
- the data area.plot
- the plot.domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the data.visibleRow
- the visible row index.row
- the row index (zero-based).column
- the column index (zero-based).
equals
public boolean equals(Object obj)
- Tests this renderer for equality with an arbitrary object.
- Overrides:
equals
in class BarRenderer
- Parameters:
obj
- the object (null
permitted).
- Returns:
- A boolean.
Copyright © 2001-2012 JFree.org. All Rights Reserved.