Class BarXYZRenderer

All Implemented Interfaces:
Serializable, ChartElement, Renderer3D, XYZRenderer

A renderer that draws 3D bars on an XYZPlot using data from an XYZDataset. Here is a sample:
XYZBarChart3DDemo1.svg
(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:
  • 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

      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:
    • 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:
    • 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.