NAME

Image::OrgChart - Perl extension for writing org charts

SYNOPSIS

use Image::OrgChart;
use strict; # every job should, eh ?

my $org_chart = Image::OrgChart->new();
$org_chart->add('/manager/middle-manager/employee1');
$org_chart->add('/manager/middle-manager/employee2');
$org_chart->add('/manager/middle-manager/employee3');
$org_chart->add('/manager/middle-manager/employee4');

$data = $org_chart->draw();
if ($org_chart->data_type() eq 'gif') {
    ## write gif file
} elsif ($org_chart->data_type() eq 'png') {
    ## write png file
}

DESCRIPTION

Image::OrgChart, uses the perl GD module to create OrgChart style images in gif or png format, depending on which is available from your version of GD.
There are several ways to add data to the object, but the most common is the C<$object->add($path)>. The C<$path> can be seperated by any charachter, but the default is a L</>. See the C<new()> method for that and other configuration options.

FUNCTIONS

new([OPTIONS])
Created a new Image::OrgChart object. Takes a hash-like list of configuration options. See list below.
  • box_color - box border color in arrref triplet. default [0,0,0]
  • box_fill_color - box fill color in arrref triplet. default [75,75,75] 
  • connect_color - line color in arrref triplet. default [0,0,0]
  • text_color - text color in arrref triplet. default [0,0,0]
  • bg_color - bg color in arrref triplet. default [255,255,255]
  • arrow_heads - 1/0, currently unimplimented
  • fill_boxes - 1/0, currently unimplimented
  • h_spacing - horizontal spacing in (in pixels)
  • v_spacing - vertical spacing in (in pixels)
  • path_seperator - Seperator to use for paths provided by the add() command.

add(PATH)
Add data to the object using a seperated scalar. The seperator can be set in the C<new()> constructor, but defaults to L</>.
set_hashref(HASH_REF)
This allows assignment of a hash-of-hashes as the data element of the object. People who have not persons underneath them should have an empty hash-reference as the value. e.g.
    $hash{'root'}{'foo'} = {
                            'bar'      => {},
                            'more foo' => {},
                            'kung-foo' => {},
                           };
                           
draw()
this plots all of the data from the object and returns the image data.
data_type()
returns the data type used by the version of GD in use.
 

EXPORT

None by default.

HISTORY

0.01

Original version; created by h2xs with options

-AXC -v 0.01 -n Image::OrgChart

AUTHOR

Matt Sanford <mzsanford@cpan.org>

SEE ALSO

perl(1),GD

1 POD Error

The following errors were encountered while parsing the POD:

Around line 342:

You forgot a '=back' before '=head2'