Package qa.chart.fx

Class QAChart

java.lang.Object
qa.chart.fx.QAChart

public class QAChart extends Object
Create a chart showing missed detections as bars along the bottom, found detections as bars along the top (inverted), and a probability line graph through the middle (overlayed on top of everything). Used a number of websites for code examples... How to layer charts using a StackPane: https://gist.github.com/jewelsea/3668862 There is a problem with the x-axis not lining up when you have y-axis on both left and right sides: https://stackoverflow.com/questions/30204122/aligning-the-primary-and-secondary-x-axis-in-stackpane-xychart-in-javafx To fix problem of x-axis not lining up (resizing charts to make room for y-axis on left and right): https://gist.github.com/MaciejDobrowolski/9c99af00668986a0a303#file-style-css
Author:
mo55
  • Constructor Details

    • QAChart

      public QAChart(String title, int[] xCat, int[] yDetected, int[] yMissed)
      Main constructor. Need to pass in all of the data right away.
      Parameters:
      title - The title of the chart (not currently used, as it overlaps with the inverted axis)
      xCat - range values to be used along the x-axis
      yDetected - the number of detected sounds at each range location - length must match xCat vector
      yMissed - the number of missed sounds at each range location - length must match xCat vector
  • Method Details

    • 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)
    • 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)
    • getPrimaryChart

      public javafx.scene.chart.XYChart.Series<String,Number> getPrimaryChart()
      Returns:
      the primaryChart