Class StackedBarRenderer3D

All Implemented Interfaces:
Serializable, ChartElement, CategoryRenderer3D, Renderer3D

public class StackedBarRenderer3D extends BarRenderer3D
A renderer that can be used with the CategoryPlot3D class to create 3D stacked bar charts from data in a CategoryDataset3D. The createStackedBarChart() method in the Chart3DFactory class will construct a chart that uses this renderer. Here is a sample:
StackedBarChart3DDemo1.svg
(refer to StackedBarChart3DDemo1.java for the code to generate the above chart).

There is a factory method to create a chart using this renderer - see Chart3DFactory.createStackedBarChart(String, String, CategoryDataset3D, String, String, String).

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

  • Method Details

    • findValueRange

      public Range findValueRange(Values3D<? extends Number> data)
      Returns the range of values that will be required on the value axis to see all the data from the dataset. We override the method to account for the bars from each series being stacked on top of one another.
      Specified by:
      findValueRange in interface CategoryRenderer3D
      Overrides:
      findValueRange in class BarRenderer3D
      Parameters:
      data - the data (null not permitted).
      Returns:
      The range (possibly null)
    • composeItem

      public void composeItem(CategoryDataset3D dataset, int series, int row, int column, World world, Dimension3D dimensions, double xOffset, double yOffset, double zOffset)
      Constructs and places one item from the specified dataset into the given world. This method will be called by the CategoryPlot3D class while iterating over the items in the dataset.
      Specified by:
      composeItem in interface CategoryRenderer3D
      Overrides:
      composeItem in class BarRenderer3D
      Parameters:
      dataset - the dataset (null not permitted).
      series - the series index.
      row - the row index.
      column - the column index.
      world - the world (null not permitted).
      dimensions - the plot dimensions (null not permitted).
      xOffset - the x-offset.
      yOffset - the y-offset.
      zOffset - the z-offset.
    • drawItemLabels

      protected void drawItemLabels(World world, CategoryDataset3D dataset, KeyedValues3DItemKey itemKey, double xw, double yw, double zw, double basew, boolean inverted)
      Draws the item labels.
      Overrides:
      drawItemLabels in class BarRenderer3D
      Parameters:
      world - the world.
      dataset - the dataset.
      itemKey - the item key.
      xw - the x-coordinate.
      yw - the y-coordinate.
      zw - the z-coordinate.
      basew - the base coordinate.
      inverted - is the y-axis inverted?
    • equals

      public boolean equals(Object obj)
      Tests this renderer for equality with an arbitrary object.
      Overrides:
      equals in class BarRenderer3D
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.