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 TypeMethodDescriptionvoidcomposeItem(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.booleanTests 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.doubleReturns the width of the bars in the direction of the x-axis, in the units of the x-axis.doubleReturns the width of the bars in the direction of the z-axis, in the units of the z-axis.doublegetBase()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).voidsetBarXWidth(double width) Sets the width of the bars in the direction of the x-axis and sends aRenderer3DChangeEventto all registered listeners.voidsetBarZWidth(double width) Sets the width of the bars in the direction of the z-axis and sends aRenderer3DChangeEventto all registered listeners.voidsetBase(double base) Sets the base value for the bars and sends aRenderer3DChangeEventto all registered listeners.voidsetBaseColorSource(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 aRenderer3DChangeEventto all registered listeners.voidsetTopColorSource(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 aRenderer3DChangeEventto all registered listeners.Methods inherited from class org.jfree.chart3d.renderer.xyz.AbstractXYZRenderer
composeAll, getColorSource, getComposeType, getItemLabelGenerator, getPlot, setColors, setColorSource, setItemLabelGenerator, setPlotMethods inherited from class org.jfree.chart3d.renderer.AbstractRenderer3D
addChangeListener, fireChangeEvent, getItemLabelBackgroundColor, getItemLabelColor, getItemLabelFont, getItemLabelPositioning, isNotify, notifyListeners, receive, removeChangeListener, setItemLabelBackgroundColor, setItemLabelColor, setItemLabelFont, setItemLabelPositioning, setNotifyMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart3d.ChartElement
receiveMethods inherited from interface org.jfree.chart3d.renderer.Renderer3D
addChangeListener, removeChangeListenerMethods 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 aRenderer3DChangeEventto 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 aRenderer3DChangeEventto 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 aRenderer3DChangeEventto 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 aRenderer3DChangeEventto 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.WHITEalways.- Parameters:
source- the source (nullpermitted).- 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 aRenderer3DChangeEventto all registered listeners.- Parameters:
source- the source (nullpermitted).- 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:
findXRangein interfaceXYZRenderer- Overrides:
findXRangein classAbstractXYZRenderer- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- The range (
nullif 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:
findYRangein interfaceXYZRenderer- Overrides:
findYRangein classAbstractXYZRenderer- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- The range (
nullwhen 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:
findZRangein interfaceXYZRenderer- Overrides:
findZRangein classAbstractXYZRenderer- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- The range (
nullwhen 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:
composeItemin 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:
equalsin classAbstractXYZRenderer- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-