Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
8369:a5bd0a5b8efd | 8370:e1ff1263d79a |
---|---|
70 import org.jfree.data.xy.XYDataset; | 70 import org.jfree.data.xy.XYDataset; |
71 import org.jfree.ui.RectangleInsets; | 71 import org.jfree.ui.RectangleInsets; |
72 import org.w3c.dom.Document; | 72 import org.w3c.dom.Document; |
73 import org.w3c.dom.Element; | 73 import org.w3c.dom.Element; |
74 | 74 |
75 import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM; | |
76 | |
75 /** | 77 /** |
76 * Implementation of the OutGenerator interface for charts. | 78 * Implementation of the OutGenerator interface for charts. |
77 * It should provide some basic things that equal in all chart types. | 79 * It should provide some basic things that equal in all chart types. |
78 * | 80 * |
79 */ | 81 */ |
661 Object radius = context.getContextValue("radius"); | 663 Object radius = context.getContextValue("radius"); |
662 if (radius instanceof Double) { | 664 if (radius instanceof Double) { |
663 NumberFormat f = Formatter.getCSVFormatter(context); | 665 NumberFormat f = Formatter.getCSVFormatter(context); |
664 return s.replace("$RADIUS", f.format(radius)); | 666 return s.replace("$RADIUS", f.format(radius)); |
665 } | 667 } |
668 Object km = context.getContextValue(CURRENT_KM); | |
669 if (km instanceof Number && s.contains("$KM")) { | |
670 return s.replace(", $KM", " " + ((Double)km).toString()); | |
671 } | |
666 return s; | 672 return s; |
667 } | 673 } |
668 | 674 |
669 /** | 675 /** |
670 * Returns the subtitle of a chart. The return value depends on the | 676 * Returns the subtitle of a chart. The return value depends on the |