mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-05-17 13:20:25 -04:00
Added formatted bitrate values to interface charts
This commit is contained in:
parent
3ace328918
commit
c35f6418a2
2 changed files with 11 additions and 7 deletions
6
nomadnet/vendor/AsciiChart.py
vendored
6
nomadnet/vendor/AsciiChart.py
vendored
|
@ -46,7 +46,11 @@ class AsciiChart:
|
|||
result = [[' '] * width for i in range(rows + 1)]
|
||||
|
||||
for y in range(min2, max2 + 1):
|
||||
label = placeholder.format(maximum - ((y - min2) * interval / (rows if rows else 1)))
|
||||
if callable(placeholder):
|
||||
label = placeholder(maximum - ((y - min2) * interval / (rows if rows else 1))).rjust(12)
|
||||
else:
|
||||
label = placeholder.format(maximum - ((y - min2) * interval / (rows if rows else 1)))
|
||||
|
||||
result[y - min2][max(offset - len(label), 0)] = label
|
||||
result[y - min2][offset - 1] = symbols[0] if y == 0 else symbols[1]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue