Package reportWriter

Class ReportChart

java.lang.Object
reportWriter.ReportChart

public class ReportChart extends Object
Author:
mo55
  • Constructor Details

    • ReportChart

      public ReportChart(String title)
      Main constructor. This initializes the FX Toolkit by creating a JFXPanel, so that we can then use the JFX objects later
      Parameters:
      title - The title of the chart (can be null)
  • Method Details

    • addSeries

      public void addSeries(String seriesName, double[] xVals, double[] yVals)
      Add a data series to the chart
      Parameters:
      seriesName - A descriptor of the series (required)
      xVals - The x-values (must be the same size as yVals)
      yVals - The y-values (must be the same size as xVals)
    • getImage

      public BufferedImage getImage()
      Return a BufferedImage of the chart.
      Returns:
      an image of the chart, or null if there was a problem
    • setAxisTitles

      public void setAxisTitles(String xTitle, String yTitle)
      Set the axis titles. If this method is not called, the axes will be unlabelled
      Parameters:
      xTitle -
      yTitle -
    • setXAxisParams

      public void setXAxisParams(double lower, double upper, double tick)
      Set the x axis parameters. If this method is not called, the parameters will be generated automatically
      Parameters:
      lower - the value of the lower bound of the axis
      upper - the value of the upper bound of the axis
      tick - the value between each major tick mark
    • setYAxisParams

      public void setYAxisParams(double lower, double upper, double tick)
      Set the y axis parameters. If this method is not called, the parameters will be generated automatically
      Parameters:
      lower - the value of the lower bound of the axis
      upper - the value of the upper bound of the axis
      tick - the value between each major tick mark
    • getXAxisObject

      public javafx.scene.chart.NumberAxis getXAxisObject()
      Return a link to the chart's x-axis object. Can be used for advanced control of the x axis parameters
      Returns:
      NumberAxis representing the x-axis
    • getyAxisObject

      public javafx.scene.chart.NumberAxis getyAxisObject()
      Return a link to the chart's y-axis object. Can be used for advanced control of the y axis parameters
      Returns:
      NumberAxis representing the y-axis