Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Term::Spark Package
Perl Perl6
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib/Term
t
.gitignore
.travis.yml
Build.PL
Changes
LICENSE
META.json
README.md
README.pod
cpanfile
cpanfile.snapshot
minil.toml

README.md

Build Status Coverage Status

NAME

Term::Spark - Display sparklines in the terminal

SYNOPSIS

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:
▆▃▅█▁▁▃▄

DESCRIPTION

This module displays sparklines in the terminal.

METHODS

show_graph(values => \@values, max => $max)

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.

AUTHOR

Gil Gonçalves lurst@cpan.org (original author)

Eric Johnson (kablamo)

SEE ALSO

Term::Vspark - "vertical" sparklines

Original implementation: https://github.com/holman/spark

Something went wrong with that request. Please try again.