public static XYChart getChart(
      String chartTitle,
      String xTitle,
      String yTitle,
      String[] seriesNames,
      double[] xData,
      double[][] yData) {

    // Create Chart
    XYChart chart = new XYChart(WIDTH, HEIGHT);

    // Customize Chart
    chart.setTitle(chartTitle);
    chart.setXAxisTitle(xTitle);
    chart.setYAxisTitle(yTitle);

    // Series
    for (int i = 0; i < yData.length; i++) {
      XYSeries series;
      if (seriesNames != null) {
        series = chart.addSeries(seriesNames[i], xData, yData[i]);
      } else {
        chart.getStyler().setLegendVisible(false);
        series = chart.addSeries(" " + i, xData, yData[i]);
      }
      series.setMarker(SeriesMarkers.NONE);
    }
    return chart;
  }
public static XYChart getChart ( String chartTitle , String xTitle , String yTitle , String [ ] seriesNames , double [ ] xData , double [ ] [ ] yData ) { XYChart chart = new XYChart ( WIDTH , HEIGHT ) ; chart . setTitle ( chartTitle ) ; chart . setXAxisTitle ( xTitle ) ; chart . setYAxisTitle ( yTitle ) ; for ( int i = 0 ; i < yData . length ; i ++ ) { XYSeries series ; if ( seriesNames != null ) { series = chart . addSeries ( seriesNames [ i ] , xData , yData [ i ] ) ; } else { chart . getStyler ( ) . setLegendVisible ( false ) ; series = chart . addSeries ( " " + i , xData , yData [ i ] ) ; } series . setMarker ( SeriesMarkers . NONE ) ; } return chart ; }
Creates a Chart with multiple Series for the same X-Axis data with default style

@param chartTitle the Chart title
@param xTitle The X-Axis title
@param yTitle The Y-Axis title
@param seriesNames An array of the name of the multiple series
@param xData An array containing the X-Axis data
@param yData An array of double arrays containing multiple Y-Axis data
@return a Chart Object