Commit 9feae7b
committed
Dynamic scaling & Graph meter coloring
This patch adds dynamic scaling to the Bar and Graph meter, and color
for Graph meter.
Details of the features:
1. Dynamic scaling is enabled by setting a negative "total" value to
the meter. It's useful for meter like Load Average and Tasks where
a fixed maximum value doesn't make sense. For Bar meter a dynamic
"total" will be computed when drawing. For Graph meter, the "total"
will align to a power of 2 to ease the management of internal data
structures.
2. Colors on the graph will base on items of the (stacked) bars.
The colors are picked to match the percentage of the items as close
as possible, while the rounding differences (for each character)
are addressed through the different numbers of braille dots.
Due to low resolution of the character terminal, the rasterized
colors may not look nice, but it's better than nothing. :)
[v5: GraphData now tracks numRecords and recordNumCells; apply style
fixes as suggested by BenBE <BenBE@geshi.org>.]
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>1 parent 5843763 commit 9feae7b
2 files changed
Lines changed: 594 additions & 65 deletions
0 commit comments