# HG changeset patch # User Ingo Weinzierl # Date 1329395751 0 # Node ID 59047dfed8be8e87d4545b92b215fd579877e9a1 # Parent 65ff8ff20be4d17e0144e82fb0f80577ab2f11a2 Picked rev4061 from trunk. flys-artifacts/tags/2.6.1@4064 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 65ff8ff20be4 -r 59047dfed8be flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Feb 16 11:54:10 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Feb 16 12:35:51 2012 +0000 @@ -1,3 +1,11 @@ +2012-02-16 Ingo Weinzierl + + 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 Fix flys/issue150 (exposure of gravitational anomalies) diff -r 65ff8ff20be4 -r 59047dfed8be flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Thu Feb 16 11:54:10 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Thu Feb 16 12:35:51 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,