Class ExtendedStackedBarRenderer

All Implemented Interfaces:
Serializable, Cloneable, CategoryItemRenderer, org.jfree.util.PublicCloneable

public class ExtendedStackedBarRenderer
extends StackedBarRenderer
An extension of the StackedBarRenderer that can draw positive and negative totals at the top and bottom of the stacked bars.
See Also:
Serialized Form
  • Constructor Details

    • ExtendedStackedBarRenderer

      public ExtendedStackedBarRenderer()
      Creates a new renderer.
  • Method Details

    • getTotalFormatter

      public NumberFormat getTotalFormatter()
      Returns the total formatter.
      Returns:
      the total formatter (never null).
    • setTotalFormatter

      public void setTotalFormatter​(NumberFormat format)
      Sets the total formatter.
      Parameters:
      format - the formatter (null not permitted).
    • drawItem

      public void drawItem​(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)
      Draws a stacked bar for a specific item.
      Specified by:
      drawItem in interface CategoryItemRenderer
      Overrides:
      drawItem in class StackedBarRenderer
      Parameters:
      g2 - the graphics device.
      state - the renderer state.
      dataArea - the plot area.
      plot - the plot.
      domainAxis - the domain (category) axis.
      rangeAxis - the range (value) axis.
      dataset - the data.
      row - the row index (zero-based).
      column - the column index (zero-based).