Package draw

Class Chart3D

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Chart3D extends JPanel
Class for a 3D bar chart panel.
Since:
2004.06.05
See Also:
  • Field Details

    • empty

      public static final double[][] empty
      an empty data table
  • Constructor Details

    • Chart3D

      public Chart3D()
      Create a 3D bar chart panel.
      Since:
      2004.06.05 (Christian Borgelt)
  • Method Details

    • resetView

      public void resetView()
      Reset the view of the panel.
      Since:
      2004.06.05 (Christian Borgelt)
    • setFOV

      public void setFOV(double angle)
      Set the field of view (viewing angle) of the panel.
      Parameters:
      angle - the field of view (viewing angle)
      Since:
      2004.06.05 (Christian Borgelt)
    • setLayout

      public void setLayout(double gap, double thick, double offset, double size)
      Set the layout parameters for the bars.
      Parameters:
      gap - the (relative) gap between the bars
      thick - the thickness of the base plate
      offset - the label offset from base plate sides
      size - the size of the label font
      Since:
      2004.06.05 (Christian Borgelt)
    • setXLabel

      public void setXLabel(String label)
      Set the label for the x-axis.
      Parameters:
      label - the label for the x-axis
      Since:
      2004.06.05 (Christian Borgelt)
    • setYLabel

      public void setYLabel(String label)
      Set the label for the y-axis.
      Parameters:
      label - the label for the y-axis
      Since:
      2004.06.05 (Christian Borgelt)
    • setColor

      public void setColor(Color color)
      Set the color of the bars (for single color bars).
      Parameters:
      color - the color of the bars
      Since:
      2004.06.05 (Christian Borgelt)
    • setLevels

      public void setLevels(Color[] levels, double expand)
      Set the color levels for the bars (for multi-colored bars).
      Parameters:
      levels - the color levels for the bars (If levels is null, a default rainbow scale of colors is used.)
      expand - the color range expansion towards black as a fraction (that is, a number in [0,1])
      Since:
      2013.12.29 (Christian Borgelt)
    • setData

      public void setData(double[][] data)
      Set the data to display.
      Parameters:
      data - the data to display (2-dimensional)
      Since:
      2004.06.05 (Christian Borgelt)
    • build

      public void build()
      Build the bars of the chart.
      Since:
      2004.06.05 (Christian Borgelt)
    • paint

      public void paint(Graphics g)
      (Re)paint the 3D bar chart panel.
      Overrides:
      paint in class JComponent
      Parameters:
      g - the graphics to use for the painting
      Since:
      2004.06.05 (Christian Borgelt)
    • makeImage

      public BufferedImage makeImage()
      Create an image of the panel contents.
      Returns:
      an image of the panel contents
      Since:
      2007.02.09 (Christian Borgelt)