Module platform

Class StatisticalBarRenderer

All Implemented Interfaces:
Serializable, Cloneable, LegendItemSource, CategoryItemRenderer, PublicCloneable

public class StatisticalBarRenderer extends BarRenderer implements CategoryItemRenderer, Cloneable, 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:

StatisticalBarRendererSample.png
See Also:
  • Constructor Details

    • StatisticalBarRenderer

      public StatisticalBarRenderer()
      Default constructor.
  • Method Details

    • 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

      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:
    • 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).
      See Also:
    • 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).
      See Also:
    • 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.