public static XYChart getChartFromCSVDir(
      String path2Directory,
      DataOrientation dataOrientation,
      int width,
      int height,
      ChartTheme chartTheme) {

    // 1. get the directory, name chart the dir name
    XYChart chart;
    if (chartTheme != null) {
      chart = new XYChart(width, height, chartTheme);
    } else {
      chart = new XYChart(width, height);
    }

    // 2. get all the csv files in the dir
    File[] csvFiles = getAllFiles(path2Directory, ".*.csv");

    // 3. create a series for each file, naming the series the file name
    for (File csvFile : csvFiles) {
      String[] xAndYData;
      if (dataOrientation == DataOrientation.Rows) {
        xAndYData = getSeriesDataFromCSVRows(csvFile);
      } else {
        xAndYData = getSeriesDataFromCSVColumns(csvFile);
      }

      if (xAndYData[2] == null || xAndYData[2].trim().equalsIgnoreCase("")) {
        chart.addSeries(
            csvFile.getName().substring(0, csvFile.getName().indexOf(".csv")),
            getAxisData(xAndYData[0]),
            getAxisData(xAndYData[1]));
      } else {
        chart.addSeries(
            csvFile.getName().substring(0, csvFile.getName().indexOf(".csv")),
            getAxisData(xAndYData[0]),
            getAxisData(xAndYData[1]),
            getAxisData(xAndYData[2]));
      }
    }

    return chart;
  }
public static XYChart getChartFromCSVDir ( String path2Directory , DataOrientation dataOrientation , int width , int height , ChartTheme chartTheme ) { XYChart chart ; if ( chartTheme != null ) { chart = new XYChart ( width , height , chartTheme ) ; } else { chart = new XYChart ( width , height ) ; } File [ ] csvFiles = getAllFiles ( path2Directory , ".*.csv" ) ; for ( File csvFile : csvFiles ) { String [ ] xAndYData ; if ( dataOrientation == DataOrientation . Rows ) { xAndYData = getSeriesDataFromCSVRows ( csvFile ) ; } else { xAndYData = getSeriesDataFromCSVColumns ( csvFile ) ; } if ( xAndYData [ 2 ] == null || xAndYData [ 2 ] . trim ( ) . equalsIgnoreCase ( "" ) ) { chart . addSeries ( csvFile . getName ( ) . substring ( 0 , csvFile . getName ( ) . indexOf ( ".csv" ) ) , getAxisData ( xAndYData [ 0 ] ) , getAxisData ( xAndYData [ 1 ] ) ) ; } else { chart . addSeries ( csvFile . getName ( ) . substring ( 0 , csvFile . getName ( ) . indexOf ( ".csv" ) ) , getAxisData ( xAndYData [ 0 ] ) , getAxisData ( xAndYData [ 1 ] ) , getAxisData ( xAndYData [ 2 ] ) ) ; } } return chart ; }
@param path2Directory
@param dataOrientation
@param width
@param height
@param chartTheme
@return