Text::Graph::Data - Encapsulate data for Text::Graph
This document describes "Text::Graph::Data" version 0.82.
use Text::Graph::Data; my $gdat = Text::Graph::Data->new( \@values, \@labels );
Encapsulate the description of the data used by the Text::Graph object.
Text::Graph
The Text::Graph object needs data values and labels for each data value to generate appropriate graphs. The Text::Graph::Data object allows several methods of constructing this data and provides a simple interface for retrieving it.
Text::Graph::Data
The new method creates a Text::Graph::Data object. The new method can create this object from several different kinds of input.
new
If the first parameter is a single array reference, this becomes the values for the Text::Graph::Data object. If the first and second parameters are array references, they become the values and labels for the Text::Graph::Data object, respectively.
If the first parameter is a hash reference, it is used to construct the value and labels for the Text::Graph::Data object. If there are no other parameters, the keys of the hash will be sorted ASCIIbetically to generate the labels, and the values will be the corresponding values from the hash. If the second parameter is an array reference, it will be used as the labels for the the Text::Graph::Data object, and the values will be the corresponding values from the hash.
After the above parameters are taken care of, or if they did not exist, any remaining parameters are used to customize the data set. Those parameters are taken as name/value pairs to set various options on the object. The defined options are
A reference to an array of values to use for this data set.
A reference to an array of labels to use for this data set.
A reference to a hash containing the values and labels for this data set.
A reference to a subroutine that takes the list of labels and sorts them into the appropriate order. The default value is an ASCIIbetical sort.
In scalar context, get_values returns a reference to the array containing the values in this data set. In list context, it returns the values as a list.
get_values
In scalar context, get_labels returns a reference to the array containing the labels in this data set. In list context, it returns the labels as a list.
get_labels
G. Wade Johnson, gwadej@cpan.org
Copyright 2004-2014 G. Wade Johnson
This module is free software; you can distribute it and/or modify it under the same terms as Perl itself.
perl(1).
To install Text::Graph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Graph
CPAN shell
perl -MCPAN -e shell install Text::Graph
For more information on module installation, please visit the detailed CPAN module installation guide.