print only bar chart tics when they are greater than zero

This commit is contained in:
2020-10-26 10:50:54 +01:00
parent 45c1648773
commit 6536611b5d

View File

@@ -134,13 +134,15 @@ public class BarChartAggregatorForIntervals implements CustomAggregator, Indexed
int offset = 0; int offset = 0;
for (final String bucketId : bucketIds()) { for (final String bucketId : bucketIds()) {
final long count = buckets.get(bucketId).get(); final long count = buckets.get(bucketId).get();
final String label = String.format(Locale.US, "set label at %s %f, %d '%s' center front offset 0,0.3\n", // front if (count > 0) {
xAxis == GnuplotAxis.X1 ? "first" : "second", // final String label = String.format(Locale.US, "set label at %s %f, %d '%s' center front offset 0,0.3\n", // front
offset + getIndex() * SPACE_BETWEEN_BARS + 0.5, // x-axis position of the label xAxis == GnuplotAxis.X1 ? "first" : "second", //
count, // y axis position of the label offset + getIndex() * SPACE_BETWEEN_BARS + 0.5, // x-axis position of the label
String.format(Locale.US, "%,d", count)); count, // y axis position of the label
String.format(Locale.US, "%,d", count));
result.append(label); result.append(label);
}
offset += numberOfDataSeries; offset += numberOfDataSeries;
} }