Package org.moeaframework.analysis.plot
Class BarGraphBuilder
java.lang.Object
org.moeaframework.analysis.plot.PlotBuilder<BarGraphBuilder>
org.moeaframework.analysis.plot.BarGraphBuilder
Constructs a bar graph.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.moeaframework.analysis.plot.PlotBuilder
PlotBuilder.DisplayDriver
-
Field Summary
Fields inherited from class org.moeaframework.analysis.plot.PlotBuilder
paintHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbars
(String label, double[] x, double[] y, PlotAttribute... attributes) Adds a new series of bars to the plot, one for each X and Y pair.Adds a new series of bars to the plot, one for each X and Y pair.org.jfree.chart.JFreeChart
build()
Builds and returns the configured plot.Returns an instance of this builder cast to the concrete implementation typePlotBuilder
.Sets the X axis label.Sets the Y axis label.Methods inherited from class org.moeaframework.analysis.plot.PlotBuilder
applyStyle, applyStyle, barGraph, boxAndWhisker, build, buildPanel, defaultLegend, getAttribute, getDisplayDriver, getValueOrDefault, getValueOrDefault, hasAttribute, heatMap, legend, noLegend, paintHelper, save, save, save, sensitivity, setDisplayDriver, show, show, subtitle, theme, title, to2DArray, toArray, toArray, xy
-
Constructor Details
-
BarGraphBuilder
public BarGraphBuilder()Constructs a new, empty bar graph.
-
-
Method Details
-
getInstance
Description copied from class:PlotBuilder
Returns an instance of this builder cast to the concrete implementation typePlotBuilder
. This is used by any intermediate classes to returns the concrete implementation.- Specified by:
getInstance
in classPlotBuilder<BarGraphBuilder>
- Returns:
- a reference to this builder instance
-
build
public org.jfree.chart.JFreeChart build()Description copied from class:PlotBuilder
Builds and returns the configured plot.- Specified by:
build
in classPlotBuilder<BarGraphBuilder>
- Returns:
- the resulting plot
-
xLabel
Sets the X axis label.- Parameters:
label
- the label for the X axis- Returns:
- a reference to this builder
-
yLabel
Sets the Y axis label.- Parameters:
label
- the label for the Y axis- Returns:
- a reference to this builder
-
bars
Adds a new series of bars to the plot, one for each X and Y pair.- Parameters:
label
- the label for the seriesx
- the X valuesy
- the Y valuesattributes
- the attributes configuring the plot- Returns:
- a reference to this builder
-
bars
public BarGraphBuilder bars(String label, List<? extends Number> x, List<? extends Number> y, PlotAttribute... attributes) Adds a new series of bars to the plot, one for each X and Y pair.- Parameters:
label
- the label for the seriesx
- the X valuesy
- the Y valuesattributes
- the attributes configuring the plot- Returns:
- a reference to this builder
-