git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a3544b
)
prepare to facilitate other distribution markers
author
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 4 Sep 2019 14:55:32 +0000
(16:55 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 5 Sep 2019 03:11:33 +0000
(
05:11
+0200)
graph
patch
|
blob
|
history
diff --git
a/graph
b/graph
index 0a02d3e997ee407611f6d7cf4f3c1da62f9da9be..4bc6627588fe6d5a05022a6fdbc1f124ac82be87 100755
(executable)
--- a/
graph
+++ b/
graph
@@
-13,9
+13,9
@@
my $lenval = 1 + int log($order[0]) / log 10; # max string length
my $len = 1 + max map { length } @lines; # left padding
my $size = ($width - $lenval - $len) / $order[0]; # bar multiplication
my $len = 1 + max map { length } @lines; # left padding
my $size = ($width - $lenval - $len) / $order[0]; # bar multiplication
+sub orderpos { ($order[$_[0]] + $order[$_[0] + .5]) / 2 * $size }
my @barmark;
my @barmark;
-my $mean = ($order[$#order / 2] + $order[$#order / 2 + .5]) / 2;
-$barmark[ $mean * $size ] = '+'; # mean
+$barmark[ orderpos($#order / 2) ] = '+'; # mean
for my $nr (0 .. $#lines) {
my $val = $values[$nr];
for my $nr (0 .. $#lines) {
my $val = $values[$nr];