Mercurial > dive4elements > river
changeset 7151:491b645123b6
issue1493: Also transform NaN X values to empty string.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 25 Sep 2013 16:28:23 +0200 |
parents | dccac2a675db |
children | 8c169743f4d0 |
files | artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java Wed Sep 25 16:01:50 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java Wed Sep 25 16:28:23 2013 +0200 @@ -345,10 +345,22 @@ int items = data.getItemCount(i); for (int j = 0; j < items; j++) { log.debug("write data: " + data.getX(i, j) + ", " + data.getY(i, j)); + + /* + // Skip (NaN,NaN) datapoints. + if (java.lang.Double.isNaN(data.getYValue(i,j)) + && java.lang.Double.isNaN(data.getXValue(i,j))) { + continue; + } + */ + String xString; String yString; + try { - xString = format.format(data.getX(i, j)); + xString = java.lang.Double.isNaN(data.getXValue(i,j)) + ? "" + : format.format(data.getX(i, j)); yString = java.lang.Double.isNaN(data.getYValue(i, j)) ? "" : format.format(data.getY(i, j));