Creating spokes with SVG::TT::Graph::Pie

Creating spokes with SVG::TT::Graph::Pie

am 15.11.2006 22:29:27 von djb

Hi all,

Perl 5.8.4
SVG-TT-Graph-0.09
Windows XP / Solaris 10

I've had good success with SVG::TT::Graph::Pie. However, I've noticed
that if I have more than one small pie slice, the data labels become
too crowded. Is there a way to create "spokes" of some sort that let
me set the data labels just outside of the image itself, with a line to
the appropriate pie slice?

Here's some sample code to demonstrate what I mean. You'll notice that
the 'Dual SVC' labels all kind of blend into each other.

use strict;
use SVG::TT::Graph::Pie;

my @fields = (
'Install', 'Change', 'Disconnect', 'T', 'F', 'Dual SVC',
'Dual SVC Install', 'Dual SVC Disconnect'
);

my @data = qw/
26264 12193 13606 4161 2638 1004 997 794
/;

my $graph = SVG::TT::Graph::Pie->new({
fields => \@fields,
show_data_labels => 1,
graph_title => 'Integrator',
show_graph_title => 1,
key => 1,
key_placement => 'B',
});

$graph->add_data({
'data' => \@data,
'title' => 'Count',
});

open(FH, ">test.svg") or die "Unable to open file: $!\n";
print FH $graph->burn();

close(FH);

If this isn't possible atm, consider this a feature request. :)

I would submit a patch, but I'm afraid my SVG skills are woefully
inadequate.

Regards,

Dan