changeset 733:5f5e67aceb8c

#172 Charts of type duration curve will now have a lower X set to '0'. flys-artifacts/trunk@2226 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 24 Jun 2011 09:49:27 +0000
parents 39d191f011dc
children 56d70e546800
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Jun 23 21:44:24 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Jun 24 09:49:27 2011 +0000
@@ -1,3 +1,10 @@
+2011-06-24  Ingo Weinzierl <ingo@intevation.de>
+
+	  flys/issue172 (Diagramm: Ursprung der Diagramme bei Dauerzahlen)
+
+	* src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java:
+	  Charts of this type will have the lower X value set to "0".
+
 2011-06-23  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/ATWriter.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java	Thu Jun 23 21:44:24 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java	Fri Jun 24 09:49:27 2011 +0000
@@ -8,9 +8,11 @@
 
 import org.jfree.chart.JFreeChart;
 import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.axis.ValueAxis;
 import org.jfree.chart.plot.XYPlot;
 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
 import org.jfree.chart.title.TextTitle;
+import org.jfree.data.Range;
 import org.jfree.data.xy.XYSeries;
 import org.jfree.data.xy.XYSeriesCollection;
 
@@ -108,6 +110,18 @@
     }
 
 
+    @Override
+    protected boolean zoomX(XYPlot plot, ValueAxis axis, Range range, Range x) {
+        boolean zoomin = super.zoom(plot, axis, range, x);
+
+        if (!zoomin) {
+            axis.setLowerBound(0d);
+        }
+
+        return zoomin;
+    }
+
+
     public void addDatasets(JFreeChart chart) {
         XYPlot plot = (XYPlot) chart.getPlot();
 

http://dive4elements.wald.intevation.org