[PATCH] Time series chart: bounds cannot allways be assumed to be given

Wald Commits scm-commit at wald.intevation.org
Tue Dec 2 15:25:37 CET 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1417530334 -3600
# Node ID be5ce288270880e8025735461fc2aa70802e0668
# Parent  a63825ab9df9feb398cf7d9fc57558d70fceedca
Time series chart: bounds cannot allways be assumed to be given.

diff -r a63825ab9df9 -r be5ce2882708 artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java	Tue Dec 02 15:23:01 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java	Tue Dec 02 15:25:34 2014 +0100
@@ -853,8 +853,10 @@
         axisSection.setFontSize(14);
         axisSection.setFixed(false);
 
-        axisSection.setUpperTimeRange(getRightX());
-        axisSection.setLowerTimeRange(getLeftX());
+        long rightX = xBounds.isEmpty() ? 0 : getRightX();
+        long leftX = xBounds.isEmpty() ? 0 : getLeftX();
+        axisSection.setUpperTimeRange(rightX);
+        axisSection.setLowerTimeRange(leftX);
 
         axisSections.add(axisSection);
 


More information about the Dive4Elements-commits mailing list