Package edu.cnu.mdi.splot.plot
Class BarPlot
java.lang.Object
edu.cnu.mdi.splot.plot.BarPlot
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PlotPanelcreateBarPlot(String title, double[] values, String[] categories, String xLabel, String yLabel) Create a simple bar plot.static PlotPanelA demo bar plotstatic voidrebuildBars(PlotCanvas canvas) Rebuild the bar rectangles based on current values and log state.static voidresetPlotLines(PlotCanvas canvas) Reset the plot lines to match the current data world and log state.
-
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 titlevalues- the bar valuescategories- the bar categoriesxLabel- the x axis labelyLabel- the y axis label- Returns:
- the created
PlotPanel - Throws:
PlotDataException- if there is a problem creating the plot data
-
resetPlotLines
Reset the plot lines to match the current data world and log state.- Parameters:
canvas- the plot canvas
-
rebuildBars
Rebuild the bar rectangles based on current values and log state.- Parameters:
canvas- the plot canvas
-
demoBarPlot
A demo bar plot- Returns:
- the plot panel
- Throws:
PlotDataException- if there is a problem creating the plot data
-