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
A renderer that draws 3D bars on an
(refer to
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.
XYZPlot
using data from an
XYZDataset
. Here is a sample:
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:
-
Field Summary
Fields inherited from interface org.jfree.chart3d.renderer.Renderer3D
TRANSPARENT_COLOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Tests this renderer for equality with an arbitrary object.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.findYRange
(XYZDataset dataset) Returns the range to use for the y-axis to ensure that all data values are visible on the chart.findZRange
(XYZDataset dataset) Returns the range to use for the z-axis to ensure that all data values are visible on the chart.double
Returns the width of the bars in the direction of the x-axis, in the units of the x-axis.double
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.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).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 aRenderer3DChangeEvent
to all registered listeners.void
setBarZWidth
(double width) Sets the width of the bars in the direction of the z-axis and sends aRenderer3DChangeEvent
to all registered listeners.void
setBase
(double base) Sets the base value for the bars and sends aRenderer3DChangeEvent
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 aRenderer3DChangeEvent
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 aRenderer3DChangeEvent
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
Returns the value for the base of the bars. The default is0.0
.- Returns:
- The value for the base of the bars.
-
setBase
Sets the base value for the bars and sends aRenderer3DChangeEvent
to all registered listeners.- Parameters:
base
- the base.
-
getBarXWidth
Returns the width of the bars in the direction of the x-axis, in the units of the x-axis. The default value is0.8
.- Returns:
- The width of the bars.
-
setBarXWidth
Sets the width of the bars in the direction of the x-axis and sends aRenderer3DChangeEvent
to all registered listeners.- Parameters:
width
- the width.
-
getBarZWidth
Returns the width of the bars in the direction of the z-axis, in the units of the z-axis. The default value is0.8
.- Returns:
- The width of the bars.
-
setBarZWidth
Sets the width of the bars in the direction of the z-axis and sends aRenderer3DChangeEvent
to all registered listeners.- Parameters:
width
- the width.
-
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 isnull
, the regular series color will be used for the top of the bars.- Returns:
- A paint source (possibly
null
).
-
setBaseColorSource
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 aRenderer3DChangeEvent
to all registered listeners. If you set this tonull
, 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 returnsColor.WHITE
always.- Parameters:
source
- the source (null
permitted).- See Also:
-
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 isnull
, the regular series color will be used for the top of the bars.- Returns:
- A paint source (possibly
null
).
-
setTopColorSource
Sets the object used to fetch the color for the top of bars where the top of the bar is "cropped", and sends aRenderer3DChangeEvent
to all registered listeners.- Parameters:
source
- the source (null
permitted).- See Also:
-
findXRange
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 interfaceXYZRenderer
- Overrides:
findXRange
in classAbstractXYZRenderer
- Parameters:
dataset
- the dataset (null
not permitted).- Returns:
- The range (
null
if there is no data in the dataset).
-
findYRange
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 interfaceXYZRenderer
- Overrides:
findYRange
in classAbstractXYZRenderer
- Parameters:
dataset
- the dataset (null
not permitted).- Returns:
- The range (
null
when there is no data).
-
findZRange
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 interfaceXYZRenderer
- Overrides:
findZRange
in classAbstractXYZRenderer
- 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 interfaceXYZRenderer
- 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
Tests this renderer for equality with an arbitrary object.- Overrides:
equals
in classAbstractXYZRenderer
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-