public class BarPlot extends Plot
Constructor and Description |
---|
BarPlot(Bar... bars)
Constructor.
|
BarPlot(Bar[] bars,
Legend[] legends)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Canvas |
canvas()
Returns a canvas of the plot.
|
double[] |
getLowerBound()
Returns the lower bound of data.
|
double[] |
getUpperBound()
Returns the upper bound of data.
|
java.util.Optional<Legend[]> |
legends()
Returns the optional name of shape, which will be used to
draw a legend outside the box.
|
static BarPlot |
of(double[] data)
Creates a bar plot.
|
static BarPlot |
of(double[][] data,
java.lang.String[] labels)
Creates a bar plot of multiple groups/colors.
|
static BarPlot |
of(int[] data)
Creates a bar plot.
|
void |
paint(Graphics g)
Draws the shape.
|
public BarPlot(Bar... bars)
public double[] getLowerBound()
Plot
getLowerBound
in class Plot
public double[] getUpperBound()
Plot
getUpperBound
in class Plot
public java.util.Optional<Legend[]> legends()
Plot
public static BarPlot of(double[] data)
public static BarPlot of(int[] data)
public static BarPlot of(double[][] data, java.lang.String[] labels)
data
- each row is a data set of bars (bar height).labels
- the group label of data points.