Class Grapher


  • public class Grapher
    extends java.lang.Object
    Grapher 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
      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
      XYChart getChart()
      Access the internal XYChart
      void save()
      Save this graph to disk
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 graph
        testIdentifier - 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 graph
        testIdentifier - Identifier of this specific graph
        widthPX - Width of the graph
        heightPX - 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 name
        x - X data
        y - Y data
        Returns:
        XYSeries for customization
      • getChart

        public XYChart getChart()
        Access the internal XYChart
        Returns:
        Internal chart
      • save

        public void save()
                  throws java.io.IOException
        Save this graph to disk
        Throws:
        java.io.IOException - Thrown if save failed