Term::Spark - Display sparklines in the terminal
use Term::Spark qw/show_graph/;
binmode STDOUT, ':encoding(UTF-8)';
print show_graph(
values => [7,3,6,9,0,1,3,5],
max => 7,
);
# The output looks like this:
▆▃▅█▁▁▃▄
This module displays sparklines in the terminal.
This method builds a sparklines graph and returns it as a string.
The 'values' parameter should be a list of numbers.
The 'max' parameter is the maximum value of the graph. Without this parameter you cannot compare graphs because the scaling will change depending on the data. This parameter is optional.
Gil Gonçalves [email protected] (original author)
Eric Johnson (kablamo)
Term::Vspark - "vertical" sparklines
Original implementation: https://github.com/holman/spark