String axis1Name = "";
String axis2Name = "";
+ String chartTitle = "";
String resultPath = "";
XYSeriesCollection dataset = new XYSeriesCollection();
resultPath = pathToFile.substring(0, pathToFile.indexOf("vault")) + "downloads" + File.separator + userName + File.separator + "ComparisonResult.pdf";
- XYSeries series = new XYSeries("Study: " + docDTO.getStudyTitle() + " Scenario: " + docDTO.getScenarioTitle() + "Document: " + docDTO.getDocumentTitle());
+ XYSeries series = new XYSeries("Study: " + docDTO.getStudyTitle() + " Scenario: " + docDTO.getScenarioTitle() + " Document: " + docDTO.getDocumentTitle());
//read the file and get points information.
try {
Scanner input = new Scanner(compDocFile);
+ //get the title of the chart.
+ if (input.hasNext()) {
+ chartTitle = input.nextLine();
+ }
+
//get the name of the axis.
if (input.hasNext()) {
String[] tokens = input.nextLine().split(",");
} //for
JFreeChart chart = ChartFactory.createXYLineChart(
- "Comparision of Studies Results", // Title
+ chartTitle, // Title
axis1Name, // x-axis Label
axis2Name, // y-axis Label
dataset, // Dataset