changeset 3166:591be3486087

FixA: Prevent that the plot becomes to small if only one point is drawn. flys-artifacts/trunk@4779 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 25 Jun 2012 15:03:57 +0000
parents 6b13d7e7b403
children 6f1a102ec14a
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Jun 25 14:36:46 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Jun 25 15:03:57 2012 +0000
@@ -1,3 +1,8 @@
+2012-06-25	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java:
+	  Prevent that the plot becomes to small if only one point is drawn.
+
 2012-06-25	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java	Mon Jun 25 14:36:46 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java	Mon Jun 25 15:03:57 2012 +0000
@@ -258,9 +258,8 @@
         Rectangle2D area = dataset.getArea();
 
         if (area != null) {
-            double wInset = area.getHeight() * 0.25d;
-            log.debug("width: " + area.getWidth());
-            log.debug("height: "+ area.getHeight());
+            double height = area.getHeight();
+            double wInset = Math.max(height, 0.01) * 0.25d;
 
             wA.setAutoRangeIncludesZero(false);
             wA.setRange(new Range(

http://dive4elements.wald.intevation.org