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