Package io.github.frc5024.lib5k.unittest
Class Grapher
- java.lang.Object
-
- io.github.frc5024.lib5k.unittest.Grapher
-
public class Grapher extends java.lang.ObjectGrapher is a utility for producing graphs from a unit test
-
-
Constructor Summary
Constructors Constructor Description Grapher(java.lang.String testName, java.lang.String testIdentifier)Create a Grapher (this only works in unit tests)Grapher(java.lang.String testName, java.lang.String testIdentifier, int widthPX, int heightPX)Create a Grapher (this only works in unit tests)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XYSeriesaddSeries(java.lang.String name, java.util.List<java.lang.Double> x, java.util.List<java.lang.Double> y)Add an X/Y series to the graphXYChartgetChart()Access the internal XYChartvoidsave()Save this graph to disk
-
-
-
Constructor Detail
-
Grapher
public Grapher(java.lang.String testName, java.lang.String testIdentifier)Create a Grapher (this only works in unit tests)- Parameters:
testName- Name of the test producing this graphtestIdentifier- Identifier of this specific graph
-
Grapher
public Grapher(java.lang.String testName, java.lang.String testIdentifier, int widthPX, int heightPX)Create a Grapher (this only works in unit tests)- Parameters:
testName- Name of the test producing this graphtestIdentifier- Identifier of this specific graphwidthPX- Width of the graphheightPX- Height of the graph
-
-
Method Detail
-
addSeries
public XYSeries addSeries(java.lang.String name, java.util.List<java.lang.Double> x, java.util.List<java.lang.Double> y)
Add an X/Y series to the graph- Parameters:
name- Series namex- X datay- Y data- Returns:
- XYSeries for customization
-
getChart
public XYChart getChart()
Access the internal XYChart- Returns:
- Internal chart
-
save
public void save() throws java.io.IOExceptionSave this graph to disk- Throws:
java.io.IOException- Thrown if save failed
-
-