diff artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java @ 7122:038a04e001d7

Handle multiple processors for axis labeling. It now looks for the first processor that provides a label != null
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 24 Sep 2013 18:35:21 +0200
parents 7b88b87958ac
children 1a20738e9a21
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Tue Sep 24 18:33:30 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Tue Sep 24 18:35:21 2013 +0200
@@ -985,7 +985,8 @@
     public String getDefaultChartSubtitle() {
         DiagramAttributes.Title dTitle = diagramAttributes.getSubtitle();
         if (dTitle == null) {
-            return "Subtitle not configured in conf.xml";
+            /* Subtitle is optional */
+            return null;
         }
 
         return dTitle.evaluate((D4EArtifact)getMaster(), context);
@@ -1006,8 +1007,14 @@
 
     @Override
     protected String getDefaultYAxisLabel(String axisName) {
-        Processor pr = diagramAttributes.getProcessorForAxisName(axisName);
-        return pr == null ? "" : pr.getAxisLabel(this);
+        String label;
+        for (Processor pr: diagramAttributes.getProcessorsForAxisName(axisName)) {
+            label = pr.getAxisLabel(this);
+            if (label != null) {
+                return label;
+            }
+        }
+        return "No configured axis label";
     }
 
 

http://dive4elements.wald.intevation.org