Class BarGraphBuilder

java.lang.Object
org.moeaframework.analysis.plot.PlotBuilder<BarGraphBuilder>
org.moeaframework.analysis.plot.BarGraphBuilder

public class BarGraphBuilder extends PlotBuilder<BarGraphBuilder>
Constructs a bar graph.
  • Constructor Details

    • BarGraphBuilder

      public BarGraphBuilder()
      Constructs a new, empty bar graph.
  • Method Details

    • getInstance

      public BarGraphBuilder getInstance()
      Description copied from class: PlotBuilder
      Returns an instance of this builder cast to the concrete implementation type PlotBuilder. This is used by any intermediate classes to returns the concrete implementation.
      Specified by:
      getInstance in class PlotBuilder<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 class PlotBuilder<BarGraphBuilder>
      Returns:
      the resulting plot
    • xLabel

      public BarGraphBuilder xLabel(String label)
      Sets the X axis label.
      Parameters:
      label - the label for the X axis
      Returns:
      a reference to this builder
    • yLabel

      public BarGraphBuilder yLabel(String label)
      Sets the Y axis label.
      Parameters:
      label - the label for the Y axis
      Returns:
      a reference to this builder
    • bars

      public BarGraphBuilder bars(String label, double[] x, double[] 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 series
      x - the X values
      y - the Y values
      attributes - 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 series
      x - the X values
      y - the Y values
      attributes - the attributes configuring the plot
      Returns:
      a reference to this builder