comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthChartExtender.java @ 9602:6b2496d71936

Reimplemented baseline for tkh. Extended area-dataset to be able to draw baseline.
author gernotbelger
date Tue, 12 Feb 2019 14:08:16 +0100
parents 8596f95673b1
children
comparison
equal deleted inserted replaced
9601:8f59aa01c22a 9602:6b2496d71936
6 * This file is Free Software under the GNU AGPL (>=v3) 6 * This file is Free Software under the GNU AGPL (>=v3)
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the 7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
8 * documentation coming with Dive4Elements River for details. 8 * documentation coming with Dive4Elements River for details.
9 */ 9 */
10 package org.dive4elements.river.artifacts.sinfo.flowdepth; 10 package org.dive4elements.river.artifacts.sinfo.flowdepth;
11
12 import java.awt.BasicStroke;
13 import java.awt.Stroke;
14 11
15 import org.dive4elements.river.exports.ChartExtender; 12 import org.dive4elements.river.exports.ChartExtender;
16 import org.dive4elements.river.exports.DiagramGenerator; 13 import org.dive4elements.river.exports.DiagramGenerator;
17 import org.jfree.chart.axis.ValueAxis; 14 import org.jfree.chart.axis.ValueAxis;
18 import org.jfree.chart.plot.XYPlot; 15 import org.jfree.chart.plot.XYPlot;
58 axis1.setLowerBound(axis1lbNew); 55 axis1.setLowerBound(axis1lbNew);
59 } 56 }
60 57
61 @Override 58 @Override
62 public void afterGenerateChart(final DiagramGenerator generator, final XYPlot plot) { 59 public void afterGenerateChart(final DiagramGenerator generator, final XYPlot plot) {
63 final ValueAxis tkhAxis = generator.getAxis(TKH_AXIS); 60 /* nothing to do */
64 if (tkhAxis != null) {
65 /* show baseline if tkhAxis is present */
66
67 // TODO: it would probably better to configure this via the ChartSettings, but currently no chart settings are loaded,
68 // so it is unclear if that feature still works.
69 final Stroke baselineStroke = new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER);
70 plot.setRangeZeroBaselineStroke(baselineStroke);
71 plot.setRangeZeroBaselineVisible(true);
72 }
73 } 61 }
74 } 62 }

http://dive4elements.wald.intevation.org