Class CSVImporter
java.lang.Object
org.knowm.xchart.CSVImporter
This class is used to create a Chart object from a folder containing one or more CSV files. The
parent folder's name becomes the title of the chart. Each CSV file in the folder becomes a series
on the chart. the CSV file's name becomes the series' name.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static File[]getAllFiles(String dirName) This method returns the Files found in the given directoryprivate static File[]getAllFiles(String dirName, String regex) This method returns the files found in the given directory matching the given regular expression.getAxisData(String stringData) static XYChartgetChartFromCSVDir(String path2Directory, CSVImporter.DataOrientation dataOrientation, int width, int height) static XYChartgetChartFromCSVDir(String path2Directory, CSVImporter.DataOrientation dataOrientation, int width, int height, Styler.ChartTheme chartTheme) private static String[]getSeriesDataFromCSVColumns(File csvFile) static CSVImporter.SeriesDatagetSeriesDataFromCSVFile(String path2CSVFile, CSVImporter.DataOrientation dataOrientation) private static String[]getSeriesDataFromCSVRows(File csvFile) Get the series's data from a file
-
Constructor Details
-
CSVImporter
public CSVImporter()
-
-
Method Details
-
getChartFromCSVDir
public static XYChart getChartFromCSVDir(String path2Directory, CSVImporter.DataOrientation dataOrientation, int width, int height, Styler.ChartTheme chartTheme) - Parameters:
path2Directory-dataOrientation-width-height-chartTheme-- Returns:
-
getSeriesDataFromCSVFile
public static CSVImporter.SeriesData getSeriesDataFromCSVFile(String path2CSVFile, CSVImporter.DataOrientation dataOrientation) -
getChartFromCSVDir
public static XYChart getChartFromCSVDir(String path2Directory, CSVImporter.DataOrientation dataOrientation, int width, int height) - Parameters:
path2Directory-dataOrientation-width-height-- Returns:
-
getSeriesDataFromCSVRows
-
getSeriesDataFromCSVColumns
-
getAxisData
-
getAllFiles
This method returns the files found in the given directory matching the given regular expression.- Parameters:
dirName- - ex. "./path/to/directory/" *make sure you have the '/' on the endregex- - ex. ".*.csv"- Returns:
- File[] - an array of files
-
getAllFiles
-