CGIGraph
view release on metacpan or search on metacpan
lib/CGI/Graph.pm view on Meta::CPAN
binmode STDOUT; # make sure that STDOUT is in binary mode
print STDOUT $gd->png; # output gd object in png format
=head1 REQUIRES
Perl 5.004 or greater, CGI, GD, GD::Graph, Data::Table
=head1 FIELD SUMMARY
=over 4
=item source I<string>
name of a CSV file used for input.
=item myFile I<string>
filename used for storing selection data.
=item X,Y I<string>
names of X and Y labels, which should correspond to columns of the table.
=item center I<int,int>
the current center value of the graph, in x,y format.
=item zoom I<int>
a value indicating the size of the current view window, 1 = full view,
5 = maximum zoom.
=item divisions I<int>
the grid image is divided into divisions x divisions rectangles.
=item selected I<binary string>
each digit of the string corresponds to the selection value of the table row
at each index.
=item table I<Data::Table reference>
a reference to the Data::Table object read in from the source field.
=item width,height I<int>
width and height of main graph image and map
=item grid_width,grid_height I<int>
width and height of grid image and map
=item graph_type I<string>
indicates the type of graph. Currently, only "points" and "bar" are available.
=item zoom_type I<string>
indicates the type of zoom used for bar graphs. The default is "vertical lock",
where the vertical bounds are fixed regardless of zoom factor. Both "unlocked"
modes allow the user to change the upper bound, but the "unlocked int" mode
restricts the upper bound to an integer value.
=item histogram_type I<string>
indicates the type of histogram zoom, either "fixed" or "variable". Fixed zoom
functions similarly to the zoom style of other graph types. Variable zoom will
re-calculate the histogram of the smaller set of data which roughly corresponds
to the area in the view window.
=item dataColor,selectColor,lineColor,windowColor I<[red,green,blue], name, or hexadecimal>
indicates the color for data, selected values, grid lines, and the grid window. The value
is passed from the object as a hexadecimal value, but can be inputted as an array reference,
specific color name(see GD::Graph::colours), or hexadecimal value.
=item refresh_display I<on/undef>
the refresh_display value is stored so that it can be incoporated into the
mapInfo method.
=item x_min,x_max,y_min,y_max I<real>
minimum and maximum values for the current image or image map. Either indicates
a fractional value for elements to include or an actual mimimum or maximum.
=back
=head1 METHODS
=head2 Public Methods
=over 4
=item I<CGI::Graph::Plot::classname> CGI::Graph::Plot::classname::new($vars)
creates a new Plot. $vars is a hash reference that should contain the
keys source and myFile. The source value is used as an input and should be a
CSV file. The myFile value is used to store selection values. Optional keys are
the X and Y axes names, divisions, center, and zoom.
=item I<CGI::Graph::Plot::classname> CGI::Graph::new($vars)
creates a new Plot. Similar to the method above, but will automatically
choose an appropriate graph type.
=item I<void> Plot::all_values($filename,$size,$value)
$value is written $size number of times to the filename specified. (used to
change all selection values to 0 or 1)
=item I<string> Plot->graphParams()
returns a string of the form key1=value1&key2=value2... used to pass values to
the CGI which draws the graph.
=item I<string> Plot->gridParams()
returns a string of the form key1=value1&key2=value2... used to pass values to
the CGI which draws the grid.
( run in 2.572 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )