Class BarPlot

java.lang.Object
edu.cnu.mdi.splot.plot.BarPlot

public class BarPlot extends Object
A utility class for creating and managing bar plots in sPlot. It actually creates an XY plot with special styling to mimic a bar plot.
Author:
heddle
  • Constructor Details

    • BarPlot

      public BarPlot()
  • Method Details

    • createBarPlot

      public static PlotPanel createBarPlot(String title, double[] values, String[] categories, String xLabel, String yLabel) throws PlotDataException
      Create a simple bar plot. Actually creates an XY plot to mimic a bar plot.
      Parameters:
      title - the plot title
      values - the bar values
      categories - the bar categories
      xLabel - the x axis label
      yLabel - the y axis label
      Returns:
      the created PlotPanel
      Throws:
      PlotDataException - if there is a problem creating the plot data
    • resetPlotLines

      public static void resetPlotLines(PlotCanvas canvas)
      Reset the plot lines to match the current data world and log state.
      Parameters:
      canvas - the plot canvas
    • rebuildBars

      public static void rebuildBars(PlotCanvas canvas)
      Rebuild the bar rectangles based on current values and log state.
      Parameters:
      canvas - the plot canvas
    • demoBarPlot

      public static PlotPanel demoBarPlot() throws PlotDataException
      A demo bar plot
      Returns:
      the plot panel
      Throws:
      PlotDataException - if there is a problem creating the plot data