render images without any data on it instead of throwing errors

This makes it easier to use the mouse wheel
to zoom in. Without it you could zoom into
a region that had not data and then had to
use the date picker to change the date.
This commit is contained in:
2019-10-31 19:30:29 +01:00
parent 57be6f64e2
commit 3303afd115
2 changed files with 5 additions and 5 deletions

View File

@@ -103,7 +103,11 @@ public class GnuplotFileGenerator {
appendf(result, "plot ");
settings.getAggregates().addPlots(result, dataSeries);
settings.getAggregates().addPlots(result, dataSeries);
// Add a plot outside of the visible range. Without this gnuplot would not
// render images when there are not data points on it.
appendf(result, "-1 with lines notitle");
return result.toString();
}

View File

@@ -97,10 +97,6 @@ public class Plotter {
});
METRICS_LOGGER.debug("csv generation took: " + (System.nanoTime() - start) / 1_000_000.0 + "ms");
if (dataSeries.isEmpty()) {
throw new NoDataPointsException();
}
final Limit limitBy = plotSettings.getLimitBy();
final int limit = plotSettings.getLimit();
DataSeries.sortAndLimit(dataSeries, limitBy, limit);