31 Mar 2011 01:01:56 UTC
- Distribution: Text-BarGraph
- Module version: 1.1
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (733 / 0 / 0)
- KwaliteeBus factor: 0
- 8.65% Coverage
- License: unknown
- Activity24 month
- Download (5.08KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Text::BarGraph - Text Bar graph generator
use Text::BarGraph; $graph = Text::BarGraph->new();
A module to create text bar graphs
This module takes as input a hash, where the keys are labels for bars on a graph and the values are the magnitudes of those bars.
$graph = Text::BarGraph->new(); %hash = ( alpha => 30, beta => 40, gamma => 25 ); print $g->graph(\%hash);
$graph = Text::BarGraph->new();
$graph_text = $graph->graph(\%data);
Return a graph of the data in the supplied hash. The keys in the hash are labels, and the values are the magnitudes.
Set the character used in the graph.
Whether to display the numerical value of each bar
Set what to use to sort the graph. Valid values are "data" and "key". Key sorts by the bar's label, data sorts by the bar's magnitude.
Whether to sort bar labels as strings or numerically. Valid values are "string" and "numeric". This option is ignored when sorting by 'data'
Sets the initial value (far left) of the graph. Ignored if autozero is set. When zero is non-zero, an extra row will be printed to identify the minimum value.
Automatically choose the initial value (far left) of the graph. Overrides any value set with zero.
Forces the end of the graph (right side) to be larger than the maximum value in the graph. If the supplied value is less than the maximum value, it will be ignored.
Set the number of columns to use when displaying the graph. This value is ignored if autosize is used.
Automatically determine the size of the display. Only works if Term::ReadKey is installed and a terminal is detected. Otherwise, the value set by columns is used.
Whether to use ANSI color on the bargraph. Uses Term::ANSIColor if it is present.
Kirk Baucom <email@example.com>
Copyright (c) 2011 Kirk Baucom. All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Text::BarGraph, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Text::BarGraph
For more information on module installation, please visit the detailed CPAN module installation guide.