List of usage examples for org.jfree.data.io CSV readCategoryDataset
public CategoryDataset readCategoryDataset(Reader in) throws IOException
From source file:de.xirp.chart.ChartUtil.java
/** * Returns a {@link org.jfree.data.category.CategoryDataset} * generated from a CSV {@link java.io.File}. * //from w w w . j a v a 2 s. c o m * @param csvFile * The file to read the values from. * @return A <code>CategoryDataset</code> generated from a csv * file. * @see org.jfree.data.category.CategoryDataset */ public static CategoryDataset getCategoryDatasetFromCSV(File csvFile) { CSV csv = new CSV(',', '"'); CategoryDataset dataset = null; try { FileReader fr = new FileReader(csvFile); dataset = csv.readCategoryDataset(fr); } catch (FileNotFoundException e) { logClass.error("Error: " + e.getMessage() //$NON-NLS-1$ + Constants.LINE_SEPARATOR, e); } catch (IOException e) { logClass.error("Error: " + e.getMessage() //$NON-NLS-1$ + Constants.LINE_SEPARATOR, e); } return dataset; }