Module org.jfree.chart3d
Package org.jfree.chart3d.renderer.xyz

# Class BarXYZRenderer

java.lang.Object
org.jfree.chart3d.renderer.AbstractRenderer3D
org.jfree.chart3d.renderer.xyz.AbstractXYZRenderer
org.jfree.chart3d.renderer.xyz.BarXYZRenderer

All Implemented Interfaces:
  `Serializable`, `ChartElement`, `Renderer3D`, `XYZRenderer`

public class BarXYZRenderer extends AbstractXYZRenderer implements XYZRenderer, Serializable
A renderer that draws 3D bars on an `XYZPlot` using data from an `XYZDataset`. Here is a sample:
(refer to `XYZBarChart3DDemo1.java` for the code to generate the above chart).
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.

See Also:
  - Serialized Form

## Field Summary

### Fields inherited from interface org.jfree.chart3d.renderer.Renderer3D

`TRANSPARENT_COLOR`

## Constructor Summary

Constructors
Constructor
Description
`BarXYZRenderer()`
Creates a new default instance.

## Method Summary

Modifier and Type
Method
Description
`void`
`composeItem(XYZDataset dataset, int series, int item, World world, Dimension3D dimensions, double xOffset, double yOffset, double zOffset)`
Adds a single bar representing one item from the dataset.
`boolean`
`equals(Object obj)`
Tests this renderer for equality with an arbitrary object.
`Range`
`findXRange(XYZDataset dataset)`
Returns the range that needs to be set on the x-axis in order for this renderer to be able to display all the data in the supplied dataset.
`Range`
`findYRange(XYZDataset dataset)`
Returns the range to use for the y-axis to ensure that all data values are visible on the chart.
`Range`
`findZRange(XYZDataset dataset)`
Returns the range to use for the z-axis to ensure that all data values are visible on the chart.
`double`
`getBarXWidth()`
Returns the width of the bars in the direction of the x-axis, in the units of the x-axis.
`double`
`getBarZWidth()`
Returns the width of the bars in the direction of the z-axis, in the units of the z-axis.
`double`
`getBase()`
Returns the value for the base of the bars.
`XYZColorSource`
`getBaseColorSource()`
Returns the object used to fetch the color for the base of bars where the base of the bar is "cropped" (on account of the base value falling outside of the bounds of the y-axis).
`XYZColorSource`
`getTopColorSource()`
Returns the object used to fetch the color for the top of bars where the top of the bar is "cropped" (on account of the data value falling outside of the bounds of the y-axis).
`void`
`setBarXWidth(double width)`
Sets the width of the bars in the direction of the x-axis and sends a `Renderer3DChangeEvent` to all registered listeners.
`void`
`setBarZWidth(double width)`
Sets the width of the bars in the direction of the z-axis and sends a `Renderer3DChangeEvent` to all registered listeners.
`void`
`setBase(double base)`
Sets the base value for the bars and sends a `Renderer3DChangeEvent` to all registered listeners.
`void`
`setBaseColorSource(XYZColorSource source)`
Sets the object that determines the color to use for the base of bars where the base value falls outside the axis range, and sends a `Renderer3DChangeEvent` to all registered listeners.
`void`
`setTopColorSource(XYZColorSource source)`
Sets the object used to fetch the color for the top of bars where the top of the bar is "cropped", and sends a `Renderer3DChangeEvent` to all registered listeners.

### Methods inherited from class org.jfree.chart3d.renderer.xyz.AbstractXYZRenderer

`composeAll, getColorSource, getComposeType, getItemLabelGenerator, getPlot, setColors, setColorSource, setItemLabelGenerator, setPlot`

### Methods inherited from class org.jfree.chart3d.renderer.AbstractRenderer3D

`addChangeListener, fireChangeEvent, getItemLabelBackgroundColor, getItemLabelColor, getItemLabelFont, getItemLabelPositioning, isNotify, notifyListeners, receive, removeChangeListener, setItemLabelBackgroundColor, setItemLabelColor, setItemLabelFont, setItemLabelPositioning, setNotify`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.jfree.chart3d.ChartElement

`receive`

### Methods inherited from interface org.jfree.chart3d.renderer.Renderer3D

`addChangeListener, removeChangeListener`

### Methods inherited from interface org.jfree.chart3d.renderer.xyz.XYZRenderer

`composeAll, getColorSource, getComposeType, getPlot, setColors, setColorSource, setPlot`

## Constructor Details

### BarXYZRenderer

public BarXYZRenderer()
Creates a new default instance.

## Method Details

### getBase

public double getBase()
Returns the value for the base of the bars. The default is `0.0`.

Returns:
  The value for the base of the bars.

### setBase

public void setBase(double base)
Sets the base value for the bars and sends a `Renderer3DChangeEvent` to all registered listeners.

Parameters:
  `base` - the base.

### getBarXWidth

public double getBarXWidth()
Returns the width of the bars in the direction of the x-axis, in the units of the x-axis. The default value is `0.8`.

Returns:
  The width of the bars.

### setBarXWidth

public void setBarXWidth(double width)
Sets the width of the bars in the direction of the x-axis and sends a `Renderer3DChangeEvent` to all registered listeners.

Parameters:
  `width` - the width.

### getBarZWidth

public double getBarZWidth()
Returns the width of the bars in the direction of the z-axis, in the units of the z-axis. The default value is `0.8`.

Returns:
  The width of the bars.

### setBarZWidth

public void setBarZWidth(double width)
Sets the width of the bars in the direction of the z-axis and sends a `Renderer3DChangeEvent` to all registered listeners.

Parameters:
  `width` - the width.

### getBaseColorSource

public XYZColorSource getBaseColorSource()
Returns the object used to fetch the color for the base of bars where the base of the bar is "cropped" (on account of the base value falling outside of the bounds of the y-axis). This is used to give a visual indication to the end-user that the bar on display is cropped. If this paint source is `null`, the regular series color will be used for the top of the bars.

Returns:
  A paint source (possibly `null`).

### setBaseColorSource

public void setBaseColorSource(XYZColorSource source)
Sets the object that determines the color to use for the base of bars where the base value falls outside the axis range, and sends a `Renderer3DChangeEvent` to all registered listeners. If you set this to `null`, the regular series color will be used to draw the base of the bar, but it will be harder for the end-user to know that only a section of the bar is visible in the chart. Note that the default base paint source returns `Color.WHITE` always.

Parameters:
  `source` - the source (`null` permitted).
See Also:
  - `getBaseColorSource()`
  - `getTopColorSource()`

### getTopColorSource

public XYZColorSource getTopColorSource()
Returns the object used to fetch the color for the top of bars where the top of the bar is "cropped" (on account of the data value falling outside of the bounds of the y-axis). This is used to give a visual indication to the end-user that the bar on display is cropped. If this paint source is `null`, the regular series color will be used for the top of the bars.

Returns:
  A paint source (possibly `null`).

### setTopColorSource

public void setTopColorSource(XYZColorSource source)
Sets the object used to fetch the color for the top of bars where the top of the bar is "cropped", and sends a `Renderer3DChangeEvent` to all registered listeners.

Parameters:
  `source` - the source (`null` permitted).
See Also:
  - `getTopColorSource()`
  - `getBaseColorSource()`

### findXRange

public Range findXRange(XYZDataset dataset)
Returns the range that needs to be set on the x-axis in order for this renderer to be able to display all the data in the supplied dataset.

Specified by:
  `findXRange` in interface `XYZRenderer`
Overrides:
  `findXRange` in class `AbstractXYZRenderer`
Parameters:
  `dataset` - the dataset (`null` not permitted).
Returns:
  The range (`null` if there is no data in the dataset).

### findYRange

public Range findYRange(XYZDataset dataset)
Returns the range to use for the y-axis to ensure that all data values are visible on the chart. This method is overridden to ensure that the base value is included.

Specified by:
  `findYRange` in interface `XYZRenderer`
Overrides:
  `findYRange` in class `AbstractXYZRenderer`
Parameters:
  `dataset` - the dataset (`null` not permitted).
Returns:
  The range (`null` when there is no data).

### findZRange

public Range findZRange(XYZDataset dataset)
Returns the range to use for the z-axis to ensure that all data values are visible on the chart. This method is overridden to account for the bar widths.

Specified by:
  `findZRange` in interface `XYZRenderer`
Overrides:
  `findZRange` in class `AbstractXYZRenderer`
Parameters:
  `dataset` - the dataset (`null` not permitted).
Returns:
  The range (`null` when there is no data).

### composeItem

public void composeItem(XYZDataset dataset, int series, int item, World world, Dimension3D dimensions, double xOffset, double yOffset, double zOffset)
Adds a single bar representing one item from the dataset.

Specified by:
  `composeItem` in interface `XYZRenderer`
Parameters:
  `dataset` - the dataset.
  `series` - the series index.
  `item` - the item index.
  `world` - the world used to model the 3D chart.
  `dimensions` - the plot dimensions in 3D.
  `xOffset` - the x-offset.
  `yOffset` - the y-offset.
  `zOffset` - the z-offset.

### equals

public boolean equals(Object obj)
Tests this renderer for equality with an arbitrary object.

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