## org.jfree.chart.renderer
Class LevelRenderer

    java.lang.Object
      org.jfree.chart.renderer.AbstractRenderer
          org.jfree.chart.renderer.AbstractCategoryItemRenderer
              org.jfree.chart.renderer.LevelRenderer

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

public class LevelRenderer
extends AbstractCategoryItemRenderer
implements java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable

A `CategoryItemRenderer` that draws individual data items as horizontal lines, spaced in the same way as bars in a bar chart.

See Also:
  Serialized Form

Field Summary
`static double` `DEFAULT_ITEM_MARGIN` The default item margin percentage.

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
`LevelRenderer()` Creates a new renderer with default settings.

Method Summary
`protected double` `calculateBarW0(CategoryPlot plot, PlotOrientation orientation, java.awt.geom.Rectangle2D dataArea, CategoryAxis domainAxis, CategoryItemRendererState state, int row, int column)` Calculates the coordinate of the first "side" of a bar.
`protected void` `calculateItemWidth(CategoryPlot plot, java.awt.geom.Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state)` Calculates the bar width and stores it in the renderer state.
`protected double` `calculateSeriesWidth(double space, CategoryAxis axis, int categories, int series)` Calculates the available space for each series.
`void` `drawItem(java.awt.Graphics2D g2, CategoryItemRendererState state, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)` Draws the bar for a single (series, category) data item.
`boolean` `equals(java.lang.Object object)` Tests an object for equality with this instance.
`double` `getItemMargin()` Returns the item margin.
`double` `getMaxItemWidth()` Returns the maximum width, as a percentage of the available drawing space.
`CategoryItemRendererState` `initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)` Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method.
`void` `setItemMargin(double percent)` Sets the item margin.
`void` `setMaxItemWidth(double percent)` Sets the maximum item width, which is specified as a percentage of the available space for all items, and sends a `RendererChangeEvent` to all registered listeners.

Methods inherited from class org.jfree.chart.renderer.AbstractCategoryItemRenderer

`clone, drawBackground, drawDomainGridline, drawItemLabel, drawOutline, drawRangeGridline, drawRangeMarker, getBaseItemURLGenerator, getBaseLabelGenerator, getBaseToolTipGenerator, getColumnCount, getDomainAxis, getDrawingSupplier, getItemURLGenerator, getLabelGenerator, getLegendItem, getPlot, getRangeAxis, getRangeExtent, getRowCount, getSeriesItemURLGenerator, getSeriesLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, hashCode, setBaseItemURLGenerator, setBaseLabelGenerator, setBaseToolTipGenerator, setItemURLGenerator, setLabelGenerator, setPlot, setSeriesItemURLGenerator, setSeriesLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator`

Methods inherited from class org.jfree.chart.renderer.AbstractRenderer

`addChangeListener, calculateLabelAnchorPoint, createTransformedShape, getBaseItemLabelAnchor, getBaseItemLabelAngle, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelRotationAnchor, getBaseItemLabelsVisible, getBaseItemLabelTextAnchor, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getItemLabelAnchor, getItemLabelAnchorOffset, getItemLabelAngle, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemLabelRotationAnchor, getItemLabelTextAnchor, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelAnchor, getSeriesItemLabelAngle, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesItemLabelRotationAnchor, getSeriesItemLabelTextAnchor, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, isItemLabelVisible, isSeriesItemLabelsVisible, notifyListeners, removeChangeListener, setBaseAngle, setBaseItemLabelAnchor, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelRotationAnchor, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelTextAnchor, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setItemLabelAnchor, setItemLabelAnchorOffset, setItemLabelAngle, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelRotationAnchor, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setItemLabelTextAnchor, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesAngle, setSeriesItemLabelAnchor, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelRotationAnchor, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelTextAnchor, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setShape, setShape, setStroke, setStroke`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.jfree.util.PublicCloneable
`clone`

Methods inherited from interface org.jfree.chart.renderer.CategoryItemRenderer

`addChangeListener, getBaseItemLabelAnchor, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseItemLabelTextAnchor, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getItemLabelAnchor, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemLabelTextAnchor, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelAnchor, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesItemLabelTextAnchor, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, isItemLabelVisible, isSeriesItemLabelsVisible, removeChangeListener, setBaseItemLabelAnchor, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelTextAnchor, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseStroke, setItemLabelAnchor, setItemLabelFont, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setItemLabelTextAnchor, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelAnchor, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelTextAnchor, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setShape, setStroke`

Field Detail

### DEFAULT_ITEM_MARGIN

    public static final double DEFAULT_ITEM_MARGIN

  The default item margin percentage.

  See Also:
    Constant Field Values

Constructor Detail

### LevelRenderer

    public LevelRenderer()

  Creates a new renderer with default settings.

Method Detail

### getItemMargin

    public double getItemMargin()

  Returns the item margin.

  Returns:
    The margin.

### setItemMargin

    public void setItemMargin(double percent)

  Sets the item margin. The value is expressed as a percentage of the available width for plotting all the bars, with the resulting amount to be distributed between all the bars evenly.

  Parameters:
    `percent` - the new margin.

### getMaxItemWidth

    public double getMaxItemWidth()

  Returns the maximum width, as a percentage of the available drawing space.

  Returns:
    the maximum width.

### setMaxItemWidth

    public void setMaxItemWidth(double percent)

  Sets the maximum item width, which is specified as a percentage of the available space for all items, and sends a `RendererChangeEvent` to all registered listeners.

  Parameters:
    `percent` - the percent.

### initialise

    public CategoryItemRendererState initialise(java.awt.Graphics2D g2,
                                                java.awt.geom.Rectangle2D dataArea,
                                                CategoryPlot plot,
                                                int rendererIndex,
                                                PlotRenderingInfo info)

  Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method.

  This method gets called once at the start of the process of drawing a chart.

  Specified by:
    `initialise` in interface `CategoryItemRenderer`
  Overrides:
    `initialise` in class `AbstractCategoryItemRenderer`
  Parameters:
    `g2` - the graphics device.
    `dataArea` - the area in which the data is to be plotted.
    `plot` - the plot.
    `rendererIndex` - the renderer index.
    `info` - collects chart rendering information for return to caller.
  Returns:
    The renderer state.

### calculateItemWidth

    protected void calculateItemWidth(CategoryPlot plot,
                                      java.awt.geom.Rectangle2D dataArea,
                                      int rendererIndex,
                                      CategoryItemRendererState state)

  Calculates the bar width and stores it in the renderer state.

  Parameters:
    `plot` - the plot.
    `dataArea` - the data area.
    `rendererIndex` - the renderer index.
    `state` - the renderer state.

### calculateBarW0

    protected double calculateBarW0(CategoryPlot plot,
                                    PlotOrientation orientation,
                                    java.awt.geom.Rectangle2D dataArea,
                                    CategoryAxis domainAxis,
                                    CategoryItemRendererState state,
                                    int row,
                                    int column)

  Calculates the coordinate of the first "side" of a bar. This will be the minimum x-coordinate for a vertical bar, and the minimum y-coordinate for a horizontal bar.

  Parameters:
    `plot` - the plot.
    `orientation` - the plot orientation.
    `dataArea` - the data area.
    `domainAxis` - the domain axis.
    `state` - the renderer state (has the bar width precalculated).
    `row` - the row index.
    `column` - the column index.
  Returns:
    the coordinate.

### drawItem

    public void drawItem(java.awt.Graphics2D g2,
                         CategoryItemRendererState state,
                         java.awt.geom.Rectangle2D dataArea,
                         CategoryPlot plot,
                         CategoryAxis domainAxis,
                         ValueAxis rangeAxis,
                         CategoryDataset dataset,
                         int row,
                         int column)

  Draws the bar for a single (series, category) data item.

  Specified by:
    `drawItem` in interface `CategoryItemRenderer`
  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 dataset.
    `row` - the row index (zero-based).
    `column` - the column index (zero-based).

### calculateSeriesWidth

    protected double calculateSeriesWidth(double space,
                                          CategoryAxis axis,
                                          int categories,
                                          int series)

  Calculates the available space for each series.

  Parameters:
    `space` - the space along the entire axis (in Java2D units).
    `axis` - the category axis.
    `categories` - the number of categories.
    `series` - the number of series.
  Returns:
    the width of one series.

### equals

    public boolean equals(java.lang.Object object)

  Tests an object for equality with this instance.

  Overrides:
    `equals` in class `AbstractCategoryItemRenderer`
  Parameters:
    `object` - the object.
  Returns:
    A boolean.