NAME
GIFgraph::Map - generates HTML map text.
SYNOPSIS
use GIFgraph::Map;
DESCRIPTION
GIFgraph is a perl5 module to generate HTML map text for following graphics objects GIFgraph::pie, GIFgraph::bars, GIFgraph::point and GIFgraph::linespoints.
EXAMPLES
See the samples directory in the distribution.
USAGE
Creat the GIFgrath object, set options if you need it, creat the array of data and use plot_to_gif routine for creat GIF image. For example creat GIFgraph::pie object
$graphic = new GIFgraph::pie;
$graphic->set('title' => 'A Pie Chart',
'label' => 'Label',
'axislabelclr' => 'black',
'pie_height' => 80);
@data = (["1st","2nd","3rd","4th","5th","6th"],
[ 4, 2, 3, 4, 3, 3.5]);
$GIFimage = 'Demo.gif';
$graphic->plot_to_gif($GIFimage, \@data);
Then creat the GIFgraph::Map object
$map = new GIFgraph::Map($graphic);
Use set routine for set options.
$map->set(info => "%x slice contains %p% of %s");
And creat HTML map text using the same name of GIF image
and array of data.
$HTML_map = $map->imagemap($GIFimage, \@data);
Now you may insert $HTML_map on your HTML page.
METHODS AND FUNCTIONS
- imagemap(file, \@data)
-
Generates HTML map text using GIF file "file" and reference to array of data "\@data". This parametres must be the same as are use in plot_to_gif routine.
- set(key1 => value1, key2 => value2 .... )
-
Set options. See OPTIONS.
OPTIONS
- hrefs, lhrefs Set hyper reference for each data (hrefs), and for each legend (lhrefs). Array @hrefs must the same size as arrays in @data, otherwise null elements of @hrefs set to default. Analogily array @lhrefs must the same size as legend array. Default use the simple JavaScript code 'javascript:;' instead reference, with do nothing.
-
Example of @hrefs array:
for GIFgraph::pie
if @data = ([ "1st", "2nd", "3rd"], [ 4, 2, 3]);
then @hrefs = ["1.htm","2.htm","3.htm"];
for GIFgraph::bars GIFgraph::point and GIFgraph::linespoints
if @data = ([ "1st", "2nd", "3rd"], [ 5, 12, 24], [ 1, 2, 5]);
then @hrefs = (["1.htm","2.htm","3.htm"], ["4.htm","5.htm","6.htm"]);
Example of @lhrefs array;
if @legend = [ 'one', 'two','three'];
then @lhrefs = ["1.htm","2.htm","3.htm"];
- info, legend
-
Set information string for data and for legend. This will show in status window of your broswer. Format of this string the same for each data, but you may use special symbols for receive indiwidual information. Default is 'x=%x y=%y' for info, and '%l' for legend.
%x - Replace to x values in @data - first array
%y - Replace to y values in @data - other arrays
%s - Replace to sum of all y values. Only GIFgraph::pie object.
%p - Replace to value, which show what part of all contains this data. Only GIFgraph::pie object.
%l - Replace to legend. Only GIFgraph::bars, GIFgraph::poins and GIFgraph::linespoins objects.
AUTHOR
Roman Kosenko
Contact info
Email: romik@amk.al.lg.ua
Copyright
Copyright (C) 1999 Roman Kosenko. All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 303:
Deleting unknown formatting code R<>
- Around line 365:
=over should be: '=over' or '=over positive_number'