Warning: These wiki pages have not been edited in years and may well be out of date/inaccurate. We recommend that you use them as a starting point for further investigation, rather than gospel.
Pie Chart Component

use GD;
use GD::Graph::pie;

$title => undef
$label => undef
$height => 180
$width => 200
$pie_labels => "Yin Yan"
$pie_data => "50 50"
$pie_colors => "lred lgreen"


my @p_labels = split(/\s+/, $pie_labels);

my @p_data = split(/\s+/, $pie_data);

my @p_colors = split(/\s+/, $pie_colors);


my $pie = new GD::Graph::pie($width, $height);

'3d' => 1,
title => $title,
label => $label,
transparent => 1,
dclrs => \@p_colors
) or die "Oops";

my $gd = $pie->plot([\@p_labels, \@p_data]) or die "Oops!";
$m->print($gd->png() or die "Oops");