changeset 9445:ff0e5386de70

Variant for inverted y axis added
author mschaefer
date Tue, 21 Aug 2018 14:16:15 +0200
parents ecadc9ed0ba0
children e60584f2a531
files artifacts/src/main/java/org/dive4elements/river/exports/ChartArea.java
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }

http://dive4elements.wald.intevation.org