changeset 3118:6fb211753674

The fake calculation for SQ relation now creates only values bigger than 0. flys-artifacts/trunk@4719 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 20 Jun 2012 10:56:08 +0000
parents e7ff82a52c88
children 238803b2cb8b
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/SQRelationCalculation.java
diffstat 2 files changed, 48 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Jun 20 08:26:49 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Jun 20 10:56:08 2012 +0000
@@ -1,3 +1,9 @@
+2012-06-20  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/sq/SQRelationCalculation.java:
+	  Create only SQ objects with values > 0. Otherwise JFreeChart will break
+	  during chart creation (values for logarithmic axes have to be > 0).
+
 2012-06-20  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/conf/themes.xml: Adjusted the color of SQ Facets (lines and points)
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/SQRelationCalculation.java	Wed Jun 20 08:26:49 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/SQRelationCalculation.java	Wed Jun 20 10:56:08 2012 +0000
@@ -107,21 +107,48 @@
     protected SQ[] getFakeOutliers(int diff) {
         List<SQ> a = new ArrayList<SQ>();
 
-        a.add(new SQ(11.172500000000001-diff, 1250.0));
-        a.add(new SQ(13.407000000000002+diff, 1500.0));
-        a.add(new SQ(25.641500000000002-diff, 1750.0));
-        a.add(new SQ(17.876000000000005+diff, 2000.0));
-        a.add(new SQ(20.110500000000005-diff, 2250.0));
-        a.add(new SQ(22.345000000000002+diff, 2500.0));
-        a.add(new SQ(24.579500000000003-diff, 2750.0));
-        a.add(new SQ(26.814000000000004+diff, 3000.0));
-        a.add(new SQ(29.048500000000004-diff, 3250.0));
-        a.add(new SQ(31.283000000000005+diff, 3500.0));
-        a.add(new SQ(33.517500000000005-diff, 3750.0));
-        a.add(new SQ(35.75200000000001-diff, 4000.0));
-        a.add(new SQ(37.98650000000001+diff, 4250.0));
-        a.add(new SQ(40.22100000000001+diff, 4500.0));
-        a.add(new SQ(42.45550000000001+diff, 4750.0));
+        double[][] values = new double[15][2];
+
+        values[0][0] = 11.172500000000001-diff;
+        values[0][1] = 1250.0;
+        values[1][0] = 13.407000000000002+diff;
+        values[1][1] = 1500.0;
+        values[2][0] = 25.641500000000002-diff;
+        values[2][1] = 1750.0;
+        values[3][0] = 17.876000000000005+diff;
+        values[3][1] = 2000.0;
+        values[4][0] = 20.110500000000005-diff;
+        values[4][1] = 2250.0;
+        values[5][0] = 22.345000000000002+diff;
+        values[5][1] = 2500.0;
+        values[6][0] = 24.579500000000003-diff;
+        values[6][1] = 2750.0;
+        values[7][0] = 26.814000000000004+diff;
+        values[7][1] = 3000.0;
+        values[8][0] = 29.048500000000004-diff;
+        values[8][1] = 3250.0;
+        values[9][0] = 31.283000000000005+diff;
+        values[9][1] = 3500.0;
+        values[10][0] = 33.517500000000005-diff;
+        values[10][1] = 3750.0;
+        values[11][0] = 35.75200000000001-diff;
+        values[11][1] = 4000.0;
+        values[12][0] = 37.98650000000001+diff;
+        values[12][1] = 4250.0;
+        values[13][0] = 40.22100000000001+diff;
+        values[13][1] = 4500.0;
+        values[14][0] = 42.45550000000001+diff;
+        values[14][1] = 4750.0;
+
+        for (double[] value: values) {
+            double s = value[0];
+            double q = value[1];
+
+            s = s > 0 ? s : s * -1;
+            q = q > 0 ? q : q * -1;
+
+            a.add(new SQ(s, q));
+        }
 
         return (SQ[]) a.toArray(new SQ[a.size()]);
     }

http://dive4elements.wald.intevation.org