tchart - Create chart for your data structure
This document describes version 0.062 of tchart (from Perl distribution App-tchart), released on 2024-02-06.
Usage:
% tchart [OPTIONS] NUMBER ... % tchart [OPTIONS] < INPUT
Examples:
% echo '[1,5,10,2,4,6]' | tchart -t sparkline % tchart -t sparkline 1 5 10 2 4 6 % cat celine-dion-album-sales.json [ { "lang": "en", "sales": 3000000, "title": "unison", "year": 1990 }, { "lang": "en", "sales": 5300000, "title": "celine dion", "year": 1992 }, { "lang": "en", "sales": 16600000, "title": "the color of my love", "year": 1993 }, ... ] % tchart -l year -d sales celine-dion-album-sales.json 1990|** ( 3000000) 1992|****** ( 5300000) 1993|********************** (16600000) 1996|****************************************** (30300000) 1997|********************************************* (32100000) 1998|**************** (12100000) 2002|************* (10500000) 2003|****** ( 5100000) 2004|** ( 2600000) 2007|*** ( 3400000) 2013| ( 1300000)
This program creates a chart for your data structure, either in the form of an array, array of arrays, hash, array of hashes. You can use it to quickly visualize a data structure on a console.
It accepts input as JSON, or several other alternative formats (see the -i option). It by default outputs the chart as ASCII text. Other formats will be supported in the future.
-i
This is an early release. More options, chart types, will be added in the future.
0 on success.
1 on failure.
99 on command-line options error.
--input=STR, -i
Pick input format. Available formats: tsv (tab-separated, with no header line), tsv+h (tab-separated, with header line), json (parsed using JSON), yaml (parsed using YAML::Syck), perl (eval-ed by perl). Default is detected using simple heuristics.
tsv
tsv+h
json
yaml
perl
--output=STR, -o
Pick output chart format. Available formats: text, dump. Default is text.
--data-column, -d
--label-column, -l
--type, -t
Pick chart type. Available type: line, bar, sparkline. Default is bar.
line
bar
sparkline
Please visit the project's homepage at https://metacpan.org/release/App-tchart.
Source repository is at https://github.com/perlancar/perl-App-tchart.
Text::Chart
perlancar <perlancar@cpan.org>
To contribute, you can send patches by email/via RT, or send pull requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.
This software is copyright (c) 2024, 2016, 2014 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-tchart
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
To install App::tchart, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::tchart
CPAN shell
perl -MCPAN -e shell install App::tchart
For more information on module installation, please visit the detailed CPAN module installation guide.