[PATCH] Make Logarithmic axis immun against negative values (not throwing Exceptions in that case)

Wald Commits scm-commit at wald.intevation.org
Wed Aug 27 16:47:42 CEST 2014


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1409150858 -7200
# Node ID 8ad0b7bc3e73b8d799890dc2696e8f1201a0ac2f
# Parent  ce35bdf3d75025fc06660f480f860cc662f906da
Make Logarithmic axis immun against negative values (not throwing Exceptions in that case).

diff -r ce35bdf3d750 -r 8ad0b7bc3e73 artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Wed Aug 27 15:09:45 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Wed Aug 27 16:47:38 2014 +0200
@@ -379,10 +379,12 @@
             isLog().evaluate((D4EArtifact)getMaster(), context);
 
         if (logarithmic) {
-            return new LogarithmicAxis(label);
-        } else {
-            return new NumberAxis(label);
+            LogarithmicAxis la = new LogarithmicAxis(label);
+            la.setStrictValuesFlag(false);
+            la.setAllowNegativesFlag(true);
+            return la;
         }
+        return new NumberAxis(label);
     }
 
 


More information about the Dive4Elements-commits mailing list