Skip to content
Snippets Groups Projects
Commit 34273f8d authored by Leonard Kupper's avatar Leonard Kupper
Browse files

Added cli parameters for title and axis labels.

parent 05028084
No related branches found
No related tags found
1 merge request!38Added cli parameters for title and axis labels.
......@@ -191,9 +191,9 @@ public final class App {
CategoricalPointListContainer<PointList> container = csvParser.parse(CsvType.X_ALIGNED_CATEGORIES, CsvOrientation.VERTICAL);
mLogger.debug("Internal data representation:\n {}", container.toString());
CategoricalBarChart barChart = new CategoricalBarChart(container);
barChart.setTitle("Beispieldiagramm");
barChart.setXAxisName("Gewicht in kg");
barChart.setYAxisName("Länge in m");
barChart.setTitle(settingsReader.getSetting(SettingType.DIAGRAM_TITLE).orElse(""));
barChart.setXAxisName(settingsReader.getSetting(SettingType.X_AXIS_LABEL).orElse(""));
barChart.setYAxisName(settingsReader.getSetting(SettingType.Y_AXIS_LABEL).orElse(""));
// Render diagram
LiblouisBrailleTextRasterizer.initModule();
......
......@@ -24,7 +24,10 @@ public class CommandLineParser {
mOptions.addOption("h", SettingType.DISPLAY_HELP.toString(), false, "Print help and exit")
.addOption("c", SettingType.CSV_LOCATION.toString(), true, "Path to CSV")
.addOption("s", SettingType.SEMANTIC_MAPPING.toString(), true, "Literal for semantic mapping")
.addOption("p", SettingType.PRINTER_CONFIG_PATH.toString(), true, "Path to printer configuration file");
.addOption("p", SettingType.PRINTER_CONFIG_PATH.toString(), true, "Path to printer configuration file")
.addOption("t", SettingType.DIAGRAM_TITLE.toString(), true, "Title of the diagram.")
.addOption("x", SettingType.X_AXIS_LABEL.toString(), true, "Label of X-axis including unit.")
.addOption("y", SettingType.Y_AXIS_LABEL.toString(), true, "Label of Y-axis including unit.");
}
/**
......
......@@ -10,7 +10,10 @@ public enum SettingType {
DISPLAY_HELP("help"),
CSV_LOCATION("csv-path"),
PRINTER_CONFIG_PATH("printer-config-path"),
SEMANTIC_MAPPING("semantic-mapping");
SEMANTIC_MAPPING("semantic-mapping"),
DIAGRAM_TITLE("title"),
X_AXIS_LABEL("xLabel"),
Y_AXIS_LABEL("yLabel");
private final String mName;
......@@ -28,6 +31,12 @@ public enum SettingType {
return PRINTER_CONFIG_PATH;
case "semantic-mapping":
return SEMANTIC_MAPPING;
case "title":
return DIAGRAM_TITLE;
case "xLabel":
return X_AXIS_LABEL;
case "yLabel":
return Y_AXIS_LABEL;
default:
throw new IllegalArgumentException("Setting not available");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment