I recently purchased the Developer's guide for JfreeChart . I wanted to use it mainly to create data sets from CSV files and generate graphs. But the Guide has the following comment on the page it is supposed to explain CSV import.
I/O related classes.
To be documented.
Could I get the completed documen or some help in using the CSV class.
I have a code written to take a CSV file but the output graph is incorrect and i am unable to understand how readCategoryDataset() of the CSV classs is handling the data internally.
My code snippet, to draw a line chart by extracting the data from a log file in CSV format with two columns of data, first column to be plotted for Y Axis and the second for X axis:
CSV mcd_log = new CSV();
File file = new File("C:/eclipse/workspace/DataExtraction/res/Data.log");
BufferedReader in = new BufferedReader(new FileReader(file));
CategoryDataset data = mcd_log.readCategoryDataset((java.io.Reader)in);
JFreeChart chart = ChartFactory.createLineChart("MCD Status", "Time", "Eth1 Tx Packets", data, PlotOrientation.VERTICAL, false, true, false);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
ChartFrame frame = new ChartFrame("MCD Status", chart);