## org.jfree.chart.renderer.xy
Class ClusteredXYBarRenderer

    java.lang.Object
      org.jfree.chart.renderer.AbstractRenderer
          org.jfree.chart.renderer.xy.AbstractXYItemRenderer
              org.jfree.chart.renderer.xy.XYBarRenderer
                  org.jfree.chart.renderer.xy.ClusteredXYBarRenderer

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

    public class ClusteredXYBarRenderer

extends XYBarRenderer
implements java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable

An extension of `XYBarRenderer` that displays bars for different series values at the same x next to each other. The assumption here is that for each x (time or else) there is a y value for each series. If this is not the case, there will be spaces between bars for a given x.

This renderer does not include code to calculate the crosshair point for the plot.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.jfree.chart.renderer.xy.XYBarRenderer
`XYBarRenderer.XYBarRendererState`

Field Summary

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
`ClusteredXYBarRenderer()` Default constructor.
`ClusteredXYBarRenderer(double margin, boolean centerBarAtStartValue)` Constructs a new XY clustered bar renderer.

Method Summary
`java.lang.Object` `clone()` Returns a clone of the renderer.
`void` `drawItem(java.awt.Graphics2D g2, XYItemRendererState state, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)` Draws the visual representation of a single data item.
`boolean` `equals(java.lang.Object obj)` Tests this renderer for equality with an arbitrary object, returning `true` if `obj` is a `ClusteredXYBarRenderer` with the same settings as this renderer, and `false` otherwise.
`Range` `findDomainBounds(XYDataset dataset)` Returns the x-value bounds for the specified dataset.
`protected Range` `findDomainBoundsWithOffset(IntervalXYDataset dataset)` Iterates over the items in an `IntervalXYDataset` to find the range of x-values including the interval OFFSET so that it centers the interval around the start value.

Methods inherited from class org.jfree.chart.renderer.xy.XYBarRenderer
`drawItemLabel, getBase, getGradientPaintTransformer, getLegendBar, getLegendItem, getMargin, getNegativeItemLabelPositionFallback, getPositiveItemLabelPositionFallback, getUseYInterval, initialise, isDrawBarOutline, setBase, setDrawBarOutline, setGradientPaintTransformer, setLegendBar, setMargin, setNegativeItemLabelPositionFallback, setPositiveItemLabelPositionFallback, setUseYInterval`

Methods inherited from class org.jfree.chart.renderer.xy.AbstractXYItemRenderer

`addAnnotation, addAnnotation, addEntity, calculateDomainMarkerTextAnchorPoint, drawAnnotations, drawDomainGridLine, drawDomainLine, drawDomainMarker, drawItemLabel, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, findRangeBounds, getBaseItemLabelGenerator, getBaseToolTipGenerator, getDefaultEntityRadius, getDrawingSupplier, getItemLabelGenerator, getItemLabelGenerator, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPassCount, getPlot, getSeriesItemLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, getURLGenerator, isPointInRect, removeAnnotation, removeAnnotations, setBaseItemLabelGenerator, setBaseToolTipGenerator, setDefaultEntityRadius, setItemLabelGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator, setURLGenerator, updateCrosshairValues, updateCrosshairValues`

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

`addChangeListener, calculateLabelAnchorPoint, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, hashCode, hasListener, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, 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, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, 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`

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

Methods inherited from interface org.jfree.chart.renderer.xy.XYItemRenderer

`addAnnotation, addAnnotation, addChangeListener, drawAnnotations, drawDomainGridLine, drawDomainMarker, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, findRangeBounds, getBaseItemLabelFont, getBaseItemLabelGenerator, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getBaseToolTipGenerator, getItemLabelFont, getItemLabelFont, getItemLabelGenerator, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendItemLabelGenerator, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPassCount, getPlot, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelFont, getSeriesItemLabelGenerator, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesToolTipGenerator, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, getToolTipGenerator, getURLGenerator, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeAnnotation, removeAnnotations, removeChangeListener, setBaseItemLabelFont, setBaseItemLabelGenerator, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseStroke, setBaseToolTipGenerator, setItemLabelFont, setItemLabelGenerator, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLegendItemLabelGenerator, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPlot, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelFont, setSeriesItemLabelGenerator, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setSeriesToolTipGenerator, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setStroke, setToolTipGenerator, setURLGenerator`

Methods inherited from interface org.jfree.chart.LegendItemSource
`getLegendItems`

Constructor Detail

### ClusteredXYBarRenderer

    public ClusteredXYBarRenderer()

  Default constructor. Bar margin is set to 0.0.

### ClusteredXYBarRenderer

    public ClusteredXYBarRenderer(double margin,
                                  boolean centerBarAtStartValue)

  Constructs a new XY clustered bar renderer.

  Parameters:
    `margin` - the percentage amount to trim from the width of each bar.
    `centerBarAtStartValue` - if true, bars will be centered on the start of the time period.

Method Detail

### findDomainBounds

    public Range findDomainBounds(XYDataset dataset)

  Returns the x-value bounds for the specified dataset.

  Specified by:
    `findDomainBounds` in interface `XYItemRenderer`
  Overrides:
    `findDomainBounds` in class `XYBarRenderer`
  Parameters:
    `dataset` - the dataset (`null` permitted).
  Returns:
    The bounds (possibly `null`).

### findDomainBoundsWithOffset

    protected Range findDomainBoundsWithOffset(IntervalXYDataset dataset)

  Iterates over the items in an `IntervalXYDataset` to find the range of x-values including the interval OFFSET so that it centers the interval around the start value.

  Parameters:
    `dataset` - the dataset (`null` not permitted).
  Returns:
    The range (possibly `null`).

### drawItem

    public void drawItem(java.awt.Graphics2D g2,
                         XYItemRendererState state,
                         java.awt.geom.Rectangle2D dataArea,
                         PlotRenderingInfo info,
                         XYPlot plot,
                         ValueAxis domainAxis,
                         ValueAxis rangeAxis,
                         XYDataset dataset,
                         int series,
                         int item,
                         CrosshairState crosshairState,
                         int pass)

  Draws the visual representation of a single data item. This method is mostly copied from the superclass, the change is that in the calculated space for a singe bar we draw bars for each series next to each other. The width of each bar is the available width divided by the number of series. Bars for each series are drawn in order left to right.

  Specified by:
    `drawItem` in interface `XYItemRenderer`
  Overrides:
    `drawItem` in class `XYBarRenderer`
  Parameters:
    `g2` - the graphics device.
    `state` - the renderer state.
    `dataArea` - the area within which the plot is being drawn.
    `info` - collects information about the drawing.
    `plot` - the plot (can be used to obtain standard color information etc).
    `domainAxis` - the domain axis.
    `rangeAxis` - the range axis.
    `dataset` - the dataset.
    `series` - the series index.
    `item` - the item index.
    `crosshairState` - crosshair information for the plot (`null` permitted).
    `pass` - the pass index.

### equals

    public boolean equals(java.lang.Object obj)

  Tests this renderer for equality with an arbitrary object, returning `true` if `obj` is a `ClusteredXYBarRenderer` with the same settings as this renderer, and `false` otherwise.

  Overrides:
    `equals` in class `XYBarRenderer`
  Parameters:
    `obj` - the object (`null` permitted).
  Returns:
    A boolean.

### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

  Returns a clone of the renderer.

  Specified by:
    `clone` in interface `org.jfree.util.PublicCloneable`
  Overrides:
    `clone` in class `XYBarRenderer`
  Returns:
    A clone.
  Throws:
    `java.lang.CloneNotSupportedException` - if the renderer cannot be cloned.