Class Bar


public class Bar extends Shape
Bars with heights proportional to the value.
  • Constructor Details

    • Bar

      public Bar(double[][] data, double width, Color color)
      Constructor.
      Parameters:
      data - n x 2 array. data[][0] is the x coordinate of bar, data[][1] is the height of bar.
      width - the width of bars.
      color - the color of bars.
  • Method Details

    • paint

      public void paint(Graphics g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
    • of

      public static Bar of(int[] x)
      Creates a bar plot.
    • of

      public static Bar of(double[] x)
      Creates a bar plot.