dot

packages and services management
Log | Files | Refs | README

commit 80668990ab40cb0b1b8a2dcd124697469cc9a16f
parent bd4295e156564838dc9f8d27af6ce4ed6e4451b5
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Fri,  4 Aug 2017 09:44:55 +0200

monitor/bin/plot: leave blanks for every '?' in input

Diffstat:
Mmonitor/bin/plot | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/monitor/bin/plot b/monitor/bin/plot @@ -17,8 +17,10 @@ BEGIN { stepy = 1 # find the max and the steps - for (x = 1; x <= maxx; x++) + for (x = 1; x <= maxx; x++) { + dots[x] = !(skip[x] = (dots[x] == "?")) if (maxy < dots[x]) maxy = dots[x] + } if (!height) height = maxy height -= - height % 2 stepy = maxy / height @@ -41,7 +43,7 @@ BEGIN { # draw 'x' axis printf "%" margin "s0 +", "" for (x = 1; x <= maxx; x++) - printf "-" + printf skip[x] ? " " : "-" print "+ " maxx exit