Mercurial > dive4elements > river
changeset 2550:a992ab2588a8
#509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
flys-artifacts/trunk@4061 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 16 Feb 2012 12:15:11 +0000 |
parents | 75146a1261c4 |
children | a0d9a99a5d17 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java |
diffstat | 2 files changed, 29 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Feb 16 11:58:10 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Feb 16 12:15:11 2012 +0000 @@ -1,3 +1,11 @@ +2012-02-16 Ingo Weinzierl <ingo@intevation.de> + + flys/issue509 (Dauerlinie: Q-Achse sollte bei 0 beginnen) + + * src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java: + Set the lower bounds of the Q axis to 0 to avoid displaying negative + discharge values. + 2012-02-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/WKmsImpl.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Thu Feb 16 11:58:10 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Thu Feb 16 12:15:11 2012 +0000 @@ -161,6 +161,27 @@ } + /** + * This method overrides the method in the parent class to set the lower + * bounds of the Q axis to 0. This axis should never display negative + * values on its own. + */ + @Override + protected boolean zoomY(XYPlot plot, ValueAxis axis, Range range, Range x) { + boolean zoomin = super.zoom(plot, axis, range, x); + + if (!zoomin && axis instanceof IdentifiableNumberAxis) { + String id = ((IdentifiableNumberAxis) axis).getId(); + + if (YAXIS.Q.toString().equals(id)) { + axis.setLowerBound(0d); + } + } + + return zoomin; + } + + @Override public void doOut( ArtifactAndFacet artifactFacet,