From 14c03ee70c5ab36bc053fa9ae2b3ff711bc402d6 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 14 Oct 2015 12:18:25 +0200 Subject: [PATCH] fix histograms plots --- server/src/hist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/hist.c b/server/src/hist.c index 5a93b7ccb..8d8b8b414 100644 --- a/server/src/hist.c +++ b/server/src/hist.c @@ -134,11 +134,12 @@ void hist_plot(struct hist *h) line(); for (int i = 0; i < h->length; i++) { - int bar = HIST_HEIGHT * ((double) h->data[i] / max); - if (bar == 0) - continue; + double value = VAL(h, i); + int cnt = h->data[i]; + int bar = HIST_HEIGHT * ((double) cnt / max); - stats("%+9g | " "%5u" " | %.*s", VAL(h, i), h->data[i], bar, buf); + if (value > h->lowest || value < h->highest) + stats("%+9g | " "%5u" " | %.*s", value, cnt, bar, buf); } }