sparkline.pl - Command line tool for creating sparklines
This document describes sparkline.pl version 0.03
sparkline.pl {type} [options] --values=1,2,3,4,5 sparkline.pl {type} -o outfile.svg [options] --values=1,2,3,4,5 sparkline.pl --help
Create sparklines from a command line, printing either to stdout or a file. The command line options set the parameters passed to SVG::Sparklines to create the sparkline.
SVG::Sparklines
This program supports the following Sparkline types:
An Area sparkline is a basic line graph shaded between the line and the x axis.
Area
The Bar sparkline type is a simple bar graph or histogram.
The Line sparkline type is a simple line graph.
An RangeArea sparkline type shows high/low continuous values by displaying shading the area between two lines of continuous data.
RangeArea
The RangeBar sparkline type shows high/low pairs of related values that define a range at each of the supplied data points.
The Whisker sparkline type shows a sequence of events that can have one of two outcomes (e.g. win/loss).
See SVG::Sparkline::Manual for more details.
Provide all of the xmlns attributes on the root svg element, the default is to only supply the default SVG namespace.
Add the height and width attributes on the root svg element. This is currently the default behavior.
Do not add the height and width attributes to the root svg element.
Specify a background color for the sparkline. By default, the sparkline will have a transparent background.
Synonym for --bgcolor.
--bgcolor
Provide {length} pixels of padding on the left and right of the sparkline.
Provide {length} pixels of padding on the top and bottom of the sparkline.
Specify the height of the sparkline. The default height is 10 pixels.
Synonym for --height.
--height
Specify the width of the sparkling in pixels. The default width depends on the sparkline type and the number of data values.
Synonym for --width.
--width
This required parameter specifies the data to display on the sparkline. The supplied data can take one of three forms.
Almost all sparkline types support the default data format which is a series of numbers separated by commas. The Whisker type has limits on the values allowed. Other than that, all specified types work the same way.
Whisker
--values=1,2,3,4,5,6,7,8,9
The Whisker sparkline type supports another format which is more condensed. This is a series of '+', '-', and '0' characters that represent the high, low, and neutral ticks on the Whisker graph.
--values=+--+-0+---+++
These two sparkline types require a pair of data values for each point on the sparkline. To accomplish this, we comma-separated list of pairs of values. Each pair consists of two values separated by a colon, with the smaller value first.
--values=1:1,2:4,3:9,4:16,5:25
Synonym for --values.
--values
This parameter can be supplied multiple times to define multiple marks. Each mark has an index value and a color separated by a colon (or equals). The index value can be either a numeric index or one of the named indexes described in SVG::Sparkline::Manual under mark.
Specify the color of the data line.
Specify the distance between individual data points in the absence of a a --width. If neither --width or --xscale are supplied, the default is 2.
Thickness of the line for those sparklines that have lines. For a Bar or RangeBar sparkline, this specifies the thickness of the bar.
Gap between the bars of the Bar sparkline or the whiskers of the Whisker sparkline.
Specify the name of a file where the sparkline should be written. The file must not exist unless the --clobber parameter is supplied.
--clobber
By default, the sparkline is written to stdout.
Synonym for --outfile.
--outfile
If the file specified by --outfile does exist, this parameter gives permission for the program to overwrite the file.
Synonym for --clobber.
Display the full help documentation for sparkline.pl.
Synonym for --help.
--help
sparkline.pl requires no configuration files or environment variables.
SVG::Sparkline, Getopt::Long, and Pod::Usage.
None reported.
No bugs have been reported.
G. Wade Johnson gwadej@cpan.org
gwadej@cpan.org
Thanks to Gabor Szabo for pointing out some deficiencies in the parameter handling and usability of the sparkline.pl program.
Copyright (c) 2015, G. Wade Johnson gwadej@cpan.org. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl 5.8.0. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
To install SVG::Sparkline, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVG::Sparkline
CPAN shell
perl -MCPAN -e shell install SVG::Sparkline
For more information on module installation, please visit the detailed CPAN module installation guide.