diff flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java @ 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 eab5e5089d77
children 7ca4a287cd0e
line wrap: on
line diff
--- 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