NAME
Term::Vspark
VERSION
version 0.50
SYNOPSIS
use Term::Vspark qw/show_graph/;
binmode STDOUT, ':encoding(UTF-8)';
print show_graph(
values => [0,1,2,3,4,5],
labels => [0,1,2,3,4,5], # optional
max => 7, # optional
columns => 80, # optional
);
# The output looks like this:
# 0 ▏
# 1 ██████████▉
# 2 █████████████████████▊
# 3 ████████████████████████████████▋
# 4 ███████████████████████████████████████████▌
# 5 ██████████████████████████████████████████████████████▍
DESCRIPTION
This module displays beautiful graphs in the terminal. It is a companion to Term::Spark but instead of displaying normal sparklines it displays "vertical" sparklines.
Note that because the graph is built from utf8 characters, users must setup UTF-8 encoding for STDOUT if they wish to print the output.
NAME
Term::Vspark - Displays a graph in the terminal
METHODS
show_graph( values => \@values, labels => \@labels, max => $max, columns => $columns )
show_graph returns a string.
The 'values' parameter should be an ArrayRef of numbers. This is required.
The 'labels' parameter should be an ArrayRef of strings. This is optional. Each label will be used with the corresponding value.
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.
The 'columns' parameter is the maximum width of the graph. This parameter is optional.
The 'custom_char' parameter is the character we'll use to make the graph instead of the utf8 characters. This parameter is optional.
SEE ALSO
Original repo: https://github.com/LuRsT/vspark
SUPPORT
Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at https://github.com/kablamo/term-vspark/issues. You will be notified automatically of any progress on your issue.
Source Code
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/kablamo/term-vspark
git clone git://github.com/kablamo/term-vspark.git
AUTHOR
Gil Gonçalves <lurst@cpan.org>
CONTRIBUTORS
Eric Johnson <eric.git@iijo.org>
Gil Gonçalves <lursty@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Gil Gonçalves.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.