Module platform

Class StatisticalLineAndShapeRenderer

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

public class StatisticalLineAndShapeRenderer extends LineAndShapeRenderer implements Cloneable, PublicCloneable, Serializable
A renderer that draws shapes for each data item, and lines between data items. Each point has a mean value and a standard deviation line. For use with the CategoryPlot class. The example shown here is generated by the StatisticalLineChartDemo1.java program included in the JFreeChart Demo Collection:

StatisticalLineRendererSample.png
See Also:
  • Constructor Details

    • StatisticalLineAndShapeRenderer

      public StatisticalLineAndShapeRenderer()
      Constructs a default renderer (draws shapes and lines).
    • StatisticalLineAndShapeRenderer

      public StatisticalLineAndShapeRenderer(boolean linesVisible, boolean shapesVisible)
      Constructs a new renderer.
      Parameters:
      linesVisible - draw lines?
      shapesVisible - draw shapes?
  • 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 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 for the error indicators.
      Returns:
      The stroke used for the error indicators (possibly null).
      See Also:
    • setErrorIndicatorStroke

      public void setErrorIndicatorStroke(Stroke stroke)
      Sets the stroke used for the error indicators (if null, the item outline stroke is used instead) and sends a RendererChangeEvent to all registered listeners.
      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.
      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 dataset, int row, int column, int pass)
      Draw a single data item.
      Specified by:
      drawItem in interface CategoryItemRenderer
      Overrides:
      drawItem in class LineAndShapeRenderer
      Parameters:
      g2 - the graphics device.
      state - the renderer state.
      dataArea - the area in which the data is drawn.
      plot - the plot.
      domainAxis - the domain axis.
      rangeAxis - the range axis.
      dataset - the dataset (a StatisticalCategoryDataset is required).
      row - the row index (zero-based).
      column - the column index (zero-based).
      pass - the pass.
    • equals

      public boolean equals(Object obj)
      Tests this renderer for equality with an arbitrary object.
      Overrides:
      equals in class LineAndShapeRenderer
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Returns a hash code for this instance.
      Overrides:
      hashCode in class AbstractCategoryItemRenderer
      Returns:
      A hash code.