DOCUMENT();

loadMacros("PGstandard.pl", 'PGML.pl', 'StatisticalPlots.pl', 'PGcourse.pl');


@values  = (1,          5,        8,       2,       4);
@animals = ('Anteater', 'Bobcat', 'Camel', 'Dingo', 'Elephant');

$stat_plot = StatPlot(xvisible => 0, yvisible => 0, show_grid => 0);
$stat_plot->add_piechart(
    ~~@values,
    labels          => ~~@animals,
    radius          => 3.25,
    angle_offset    => 30,
    stroke_width    => 1,
    rounded_corners => 1
);

$total = 0;
$total += $_ for (@values);
$alt_text = 'A pie chart of animals.  ';
for (0 .. 4) {
    $alt_text .=
        "The size of the $animals[$_] wedge is about "
        . Round(100 * $values[$_] / $total, 1)
        . '% of the total. ';
}

BEGIN_PGML

>> Pie Chart of the number of animals at the local zoo <<

>>[! [$alt_text] !]{$stat_plot}{400}<<

END_PGML

BEGIN_PGML_SOLUTION
Place a detailed solution here.
END_PGML_SOLUTION

ENDDOCUMENT();