The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

GD::OrgChart - Perl extension for generating personnel organization charts

SYNOPSIS

  # This bit of code will display a simple orgchart using the
  # Imagemagick "display" command

  use GD::OrgChart;
  use constant FONT => "/some/path/to/truetype/fonts/times.ttf";
  use IO::Pipe;

  our $COMPANY;

  # put data into $COMPANY such that it looks like:
  $COMPANY =
    { text => "Gary\nHome Owner", subs => [
      { text => "Tex\nVice President, Back Yard Security", subs => [
        { text => "Ophelia\nGate Watcher" },
        { text => "Cinnamon\nDeck Sitter" },
      ]},
      { text => "Dudley\nVice President, Front Yard Security", subs => [
        { text => "Jax\nBay Window Watcher" },
        { text => "Maisie\nDoor Watcher" },
      ]},
    ]};

  our $chart = GD::OrgChart->new({ size => 12, font => FONT });
  $chart->DrawTree($COMPANY);

  our $fh = IO::Pipe->new;
  if (!$fh || !($fh->writer("display -"))) {
    # error
    ...
  }
  binmode $fh;  # just in case

  our $image = $chart->Image;
  $fh->print($image->png);
  $fh->close();

DESCRIPTION

AUTHOR

Gary A. Algier, <gaa@magpage.com>

SEE ALSO

perl.