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 %.1p% of %s (%x)");

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. Analogely 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. For %x, %y, %s and $p parameters you may use spacial format for round data: %.d{x|y|p|s}, where d is digit from 0 to 9. For example %.0p or %.3x. 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 for GIFgraph::pie object.

%p - Replace to value, which show what part of all contains this data. Only for GIFgraph::pie object.

%l - Replace to legend. Only for GIFgraph::bars, GIFgraph::poins and GIFgraph::linespoins objects.

img_option

You may set any attribute in IMG tag (excluding UseMap, Src, Width, Height and Border they will set automaticuly) use set routine: set(img_option => value), where option is IMG attribute. For example: routine set(img_Alt => 'Example'); include Alt='Example' to IMG tag.

newWindow, window_option

If newWindow set to TRUE, then link will open in new navigator window. Parameters of new window you can set using window_option parameters, analogely img_option option.

AUTHOR

Roman Kosenko

Contact info

E-mail: romik@amk.al.lg.ua

Home page: http://amk.al.lg.ua/~romik

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 384:

Deleting unknown formatting code R<>

Around line 446:

=over should be: '=over' or '=over positive_number'