[PATCH] Do not die if values <= 0 are tried to be plotted on log axis

Wald Commits scm-commit at wald.intevation.org
Wed Sep 24 16:24:48 CEST 2014


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1411568672 -7200
# Node ID c04c66839288b36c2ac047b4bf33ce5cf2034c02
# Parent  c086b06b81e57ba4108d373f597e94a485463578
Do not die if values <= 0 are tried to be plotted on log axis.

diff -r c086b06b81e5 -r c04c66839288 artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java	Wed Sep 24 13:29:34 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java	Wed Sep 24 16:24:32 2014 +0200
@@ -1231,14 +1231,19 @@
 
                 // Add contained datasets, mapping to axis.
                 for (XYDataset dataset: axisDataset.getDatasets()) {
-                    plot.setDataset(datasetIndex, dataset);
-                    plot.mapDatasetToRangeAxis(datasetIndex, axisIndex);
+                    try {
+                        plot.setDataset(datasetIndex, dataset);
+                        plot.mapDatasetToRangeAxis(datasetIndex, axisIndex);
 
-                    applyThemes(plot, dataset,
-                        datasetIndex,
-                        axisDataset.isArea(dataset));
+                        applyThemes(plot, dataset,
+                            datasetIndex,
+                            axisDataset.isArea(dataset));
 
-                    datasetIndex++;
+                        datasetIndex++;
+                    }
+                    catch (RuntimeException re) {
+                        log.error(re);
+                    }
                 }
 
                 axisDataset.setPlotAxisIndex(axisIndex);


More information about the Dive4Elements-commits mailing list