# HG changeset patch # User Felix Wolfsteller # Date 1323167912 0 # Node ID eace020067da548e3809e74f1eb9c87cb55c694e # Parent 82cefa3f954f55749045bef5a34cecf572e7a98d Further flys/issue420 fix, NaN-guard X axis extent. flys-artifacts/trunk@3360 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 82cefa3f954f -r eace020067da flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Dec 06 10:26:07 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Dec 06 10:38:32 2011 +0000 @@ -1,3 +1,11 @@ +2011-12-06 Felix Wolfsteller + + Further flys/issue420 fix (No Discharge Curves for Mosel). + + * src/main/java/de/intevation/flys/exports/XYChartGenerator.java: + (includeYRange, mergeRanges): Moved NaN-guard to lowest level. + (combineXRanges): Also NaN guard the X Axis extent. + 2011-12-06 Felix Wolfsteller Partial fix for flys/issue420 (Berechnete Abflusskurve: Kein Diagramm für diff -r 82cefa3f954f -r eace020067da flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Tue Dec 06 10:26:07 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Tue Dec 06 10:38:32 2011 +0000 @@ -78,6 +78,12 @@ /** Merge (or create given range with range so far (if any). */ private void mergeRanges(Range subRange) { + // Avoid merging NaNs, as they take min/max place forever. + if (subRange == null || + Double.isNaN(subRange.getLowerBound()) || + Double.isNaN(subRange.getUpperBound())) { + return; + } if (range == null) { range = subRange; return; @@ -93,11 +99,6 @@ /** Adjust range to include given dataset. */ public void includeYRange(XYSeries dataset) { - // Avoid merging NaNs, as they take min/max place forever. - if (Double.isNaN(dataset.getMinY()) || - Double.isNaN(dataset.getMaxY())) { - return; - } mergeRanges(new Range(dataset.getMinY(), dataset.getMaxY())); } @@ -368,6 +369,12 @@ */ private void combineXRanges(Range range, int index) { + if (range == null + || Double.isNaN(range.getLowerBound()) + || Double.isNaN(range.getUpperBound())) { + return; + } + Range old = xRanges.get(index); if (old != null) {