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.