[PATCH] Variant for inverted y axis added

Wald Commits scm-commit at wald.intevation.org
Tue Aug 21 14:16:34 CEST 2018


# HG changeset patch
# User mschaefer
# Date 1534853775 -7200
# Node ID ff0e5386de70114652ed4f59e22aeba657689de5
# Parent  ecadc9ed0ba0b740485de1708260b0ae97cadd5e
Variant for inverted y axis added

diff -r ecadc9ed0ba0 -r ff0e5386de70 artifacts/src/main/java/org/dive4elements/river/exports/ChartArea.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartArea.java	Tue Aug 21 13:41:18 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartArea.java	Tue Aug 21 14:16:15 2018 +0200
@@ -26,9 +26,16 @@
         this.xLower = axisX.getRange().getLowerBound();
         this.xUpper = axisX.getRange().getUpperBound();
         this.xLength= axisX.getRange().getLength();
-        this.yLower = axisY.getRange().getLowerBound();
-        this.yUpper = axisY.getRange().getUpperBound();
-        this.yLength= axisY.getRange().getLength();
+        if (axisY.isInverted()) {
+            this.yLower = axisY.getRange().getUpperBound();
+            this.yUpper = axisY.getRange().getLowerBound();
+            this.yLength = -axisY.getRange().getLength();
+        }
+        else {
+            this.yLower = axisY.getRange().getLowerBound();
+            this.yUpper = axisY.getRange().getUpperBound();
+            this.yLength = axisY.getRange().getLength();
+        }
         this.xIsLog = axisX instanceof LogarithmicAxis;
         this.yIsLog = axisY instanceof LogarithmicAxis;
     }


More information about the Dive4Elements-commits mailing list