From 95f57150b7efa3a412d32bfb07a1ae0149099eab Mon Sep 17 00:00:00 2001 From: mka Date: Thu, 14 Mar 2013 13:58:56 +0000 Subject: [PATCH] Title of the chart is set from input file. --- .../src/org/splat/service/StudyServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java index a34f6d5..8db0d6c 100644 --- a/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java @@ -1187,6 +1187,7 @@ public class StudyServiceImpl implements StudyService { String axis1Name = ""; String axis2Name = ""; + String chartTitle = ""; String resultPath = ""; XYSeriesCollection dataset = new XYSeriesCollection(); @@ -1201,12 +1202,17 @@ public class StudyServiceImpl implements StudyService { 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(","); @@ -1254,7 +1260,7 @@ public class StudyServiceImpl implements StudyService { } //for JFreeChart chart = ChartFactory.createXYLineChart( - "Comparision of Studies Results", // Title + chartTitle, // Title axis1Name, // x-axis Label axis2Name, // y-axis Label dataset, // Dataset -- 2.39.2