diff artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java @ 8370:e1ff1263d79a

Fixed W/Q diagram subtitle in fix analysis.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 02 Oct 2014 13:59:20 +0200
parents 130160b8d245
children 8c60595fd74c
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java	Thu Oct 02 13:57:50 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java	Thu Oct 02 13:59:20 2014 +0200
@@ -72,6 +72,8 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM;
+
 /**
  * Implementation of the OutGenerator interface for charts.
  * It should provide some basic things that equal in all chart types.
@@ -663,6 +665,10 @@
             NumberFormat f = Formatter.getCSVFormatter(context);
             return s.replace("$RADIUS", f.format(radius));
         }
+        Object km = context.getContextValue(CURRENT_KM);
+        if (km instanceof Number && s.contains("$KM")) {
+            return s.replace(", $KM", " " + ((Double)km).toString());
+        }
         return s;
     }
 

http://dive4elements.wald.intevation.org