Package ca.spatial.reportwriter
Class CompareChartWriter
java.lang.Object
ca.spatial.reportwriter.Report
ca.spatial.reportwriter.CompareChartWriter
- All Implemented Interfaces:
Selectable<Report>
,Comparable<Report>
This class creates a chart based on parameters passed on
standard input. It is designed to be run in a headless
environment. This report is not intended to be used interactively
within Patchworks.
Use this command by executing java from the command line. Pipe the commands on standard input, and receive the ourput report on standard output.
The format for the parameters passed through standard input is a series of keywords and options separated by a '=' sign, for example
report=harvest/fmuS23/areaCover location=/raid/share/Projects/AlPac/FMP_2015/version_4/analysis/scenario_list_s23 xColumn=YEAR yColumn=TOTAL normalizeColumn= title=Comparison of areaCover xcaption=X ycaption=Y scenarioCount=5 scenarioName_0=V6_S23_Base_old scenarioName_1=V6_S23_base_planned scenarioName_2=V6_S23_base_roads scenarioName_3=V6_S23_NRV scenarioName_4=V6_S23_refinement_v1 scenarioLocation_0=scenarios/S23/V6_S23_Base_old scenarioLocation_1=scenarios/S23/V6_S23_Base_planned scenarioLocation_2=scenarios/S23/V6_S23_Base_roads scenarioLocation_3=scenarios/S23/V6_S23_NRV scenarioLocation_4=scenarios/S23/V6_S23_refinement_v1 chart.type=line chart.width=400 chart.height=300 chart.seriescolor_0=#3366cc chart.linewidth_0=1Note that the keywords are case sensitive. The meanings of the keywords are as follows:
Keyword | Description |
---|---|
report | The name of the report to base the comparison on, relavite to the location and scenario parameters. The report file name should not contain an extention, as .csv will be appended by the tool. |
location | The folder that is the root of the path to the report files. |
output | THe type of output to be produced:
|
xColumn | The column in the report to use for x-axis values. The values must be the same in each report. |
yColumn | The column in the report to use for y-axis values. |
normalizeColumn | If specified, the y-values will be divided by the value in the normailizeColumn. If not specified or blank then the y-values will not be normalized. |
title | THe title to display on the chart. |
xcaption | The caption to display on the x-axis. It not specified then the xColumn value will be used. |
ycaption | The caption to display on the y-axis. It not specified then the yColumn value will be used. |
scenarioCount | The number of scenarios to be compared. |
scenarioName_n | A name to be used in the legend to represent the nth scenario being compared. Note that scenarios are counted from 0 (the first scenario name is in scenarioName_0). |
scenarioLocation_n | The partial file path used to locate the nth scenario to be compared. The complete path to each scenario data file is the combination of the location, scenarioLocation_n, and report variables. Note that scenarios are counted from 0 (the first scenario location is in scenarioLocation_0). |
chart.seriescolor_n | The color code in hex RGB triple format to use for data series n. Note that series are counted from 0 (the first series color code is in chart.seriescolor_0). |
chart.linewidth_n | The line width in pixels to use for data series n. Note that series are counted from 0 (the first series line width is in chart.linewidth_0). |
chart.xaxis.category | Specify if the x-axis should use a catigorical or numeric axis unis true or false. By default the system will use a numeric axis if the x samples are all numeric and in ascending order. |
chart.logRangeAxis | Specify if the y-axis should use a logarithmic scale using true or false. |
chart.type | The type of chart to display, using values of line, area, bar, stackedbar, pie or pie2. The pie2 format transposes sample and series valuies. |
chart.width | The width of the chart in pixels. |
chart.height | The height of the chart in pixels. |
chart.reference | A specification for horizontal reference lines to be drawn upon the chart. Multiple line may be specified, each separated with a | character. Lines are specified by a numeric value, followed by an optional color value. For example, "1000;#ff0000|2000;#0000ff|3000" would specify a red line at 1000, a blue line at 2000, and a black line at 3000. |
-
Nested Class Summary
Nested classes/interfaces inherited from class ca.spatial.reportwriter.Report
Report.GetNodesAt
-
Field Summary
Fields inherited from class ca.spatial.reportwriter.Report
AREA, LINE, PIE, SIDE_BY_SIDE_BARS, STACKED_BARS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionca.spatial.reportwriter.Report.DataCache
doReport(String reportName, PrintStream out, Map<String,Object> param, ca.spatial.reportwriter.Report.DataCache cache)
The method used by the report writer to format the requested report.String[]
getTypes()
An accessor function to retrieve the list of report types supported by this report.Object[]
init(PrintStream out)
static void
Execute the command, accepting parameters on standard input and producing output on standard output.Methods inherited from class ca.spatial.reportwriter.Report
addDefaultParam, chartImg, compareTo, csvLink, doesAnyTypes, doesCSV, doesGIF, doesHTML, doesPNG, doesType, encodeFileURL, encodeURL, endMainContent, escapeRegexChars, footer, formatColumnHeadings, formatColumnHeadings, getAdditionalFiles, getAttributeStore, getBasepart, getBasepart, getDefaultFilename, getDisplayFormat, getExtension, getExtension, getFilename, getFolderpart, getFolderpart, getLength, getNamepart, getNamepart, getPathToRoot, getReportFor, getTitle, header, htmlText, indexLink, interpolateParams, isDhandler, isIndexed, isSelected, parentIndex, patternToRegex, setAttributeStore, setDefaultParams, setDisplayFormat, setIndexed, setSelected, setTitle, toString, uniqueLabels
-
Constructor Details
-
CompareChartWriter
public CompareChartWriter()
-
-
Method Details
-
init
-
getTypes
Description copied from class:Report
An accessor function to retrieve the list of report types supported by this report. See the documentation for the TYPES variable for the list of sub-types. -
doReport
public ca.spatial.reportwriter.Report.DataCache doReport(String reportName, PrintStream out, Map<String,Object> param, ca.spatial.reportwriter.Report.DataCache cache)Description copied from class:Report
The method used by the report writer to format the requested report. This method is implemented in every custom report. Application programs generally do not need to call this method, but instead use the report writer methods to obtain reports.- Specified by:
doReport
in classReport
- Parameters:
reportName
- The full name of the report to be printed, including the extension of the sub-report (if any).out
- The output stream to print output on to.param
- A HashMap containing parameters that modify the report (for example the scenario name).
-
main
Execute the command, accepting parameters on standard input and producing output on standard output. No parameters are accepted on the command line.
-