changeset 1699:608859aa5a7e

Bugfix: #383 Add further y-axes before adjusting the ranges for each y-axis. flys-artifacts/trunk@2933 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 11 Oct 2011 10:38:54 +0000
parents 6e935087f6a1
children 13a9ee6cebef
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java
diffstat 2 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Oct 10 14:22:53 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Oct 11 10:38:54 2011 +0000
@@ -1,3 +1,11 @@
+2011-10-11  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue383 (Zweite Y-Achse wird beim Zoomen/Verschieben nicht angepasst.)
+
+	* src/main/java/de/intevation/flys/exports/XYChartGenerator.java:
+	  Call adjustAxes() before applying zoom settings with autoZoom(). We need
+	  to add new y-axes first before we adjust their ranges.
+
 2011-10-10	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/XYChartGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Mon Oct 10 14:22:53 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Tue Oct 11 10:38:54 2011 +0000
@@ -133,12 +133,12 @@
         localizeAxes(plot);
 
         removeEmptyRangeAxes(plot);
+        adjustAxes(plot);
 
         preparePointRanges(plot);
         autoZoom(plot);
 
         applyThemes(plot);
-        adjustAxes(plot);
 
         return chart;
     }
@@ -312,23 +312,18 @@
         Range xrange = getDomainAxisRange();
         Range yrange = getValueAxisRange();
 
-        for (int i = 0, num = plot.getRangeAxisCount(); i < num; i++) {
-            Range[] ranges = new Range[] {
-                xRanges.get(0),
-                yRanges.get(Integer.valueOf(i)) };
+        zoomX(plot, plot.getDomainAxis(), xRanges.get(0), xrange);
 
-            if (i == 0) {
-                ValueAxis xaxis = plot.getDomainAxis();
-                zoomX(plot, xaxis, ranges[0], xrange);
-            }
-
+        for (int i = 0, num = plot.getRangeAxisCount(); i < num; i++) {
             ValueAxis yaxis = plot.getRangeAxis(i);
 
             if (yaxis == null) {
+                logger.debug("Zoom problem: no Y Axis for index: " + i);
                 continue;
             }
 
-            zoomY(plot, yaxis, ranges[1], yrange);
+            logger.debug("Prepare zoom settings for y axis at index: " + i);
+            zoomY(plot, yaxis, yRanges.get(Integer.valueOf(i)), yrange);
         }
     }
 

http://dive4elements.wald.intevation.org