NAME

chart - Create chart for your data structure

VERSION

version 0.01

SYNOPSIS

Usage:

 % chart [OPTIONS] < INPUT

Examples:

 % 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
   },
   ...
 ]

 % chart -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)

DESCRIPTION

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.

This is an early release. More options, chart types, will be added in the future.

OPTIONS

  • --input=STR, -i

    Pick input format. Available formats: json (parsed using JSON), yaml (parsed using YAML::Syck), perl (eval-ed by perl). Default is json.

  • --output=STR, -o

    Pick output chart format. Available formats: text. Default is text.

  • --data-field, -d

  • --label-field, -l

  • --type, -t

    Pick chart type. Available type: line, bar. Default is bar.

EXIT CODES

0 on success.

99 on command-line options error.

TODO

Autodetect input format.

Option: use boxchar and Unicode characters.

Option: color.

Option: width.

FAQ

SEE ALSO

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-chart.

SOURCE

Source repository is at https://github.com/sharyanto/perl-App-chart.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-chart

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.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.