Imager-Chart-Radial

 view release on metacpan or  search on metacpan

Radial.pm  view on Meta::CPAN

      $self->{_image}->string( font  => $self->{fonts}{header}, text  => $part_b,
			       x => 45, y => 75, color => $colours{black}, aa => 1);
  } else {
    $self->{_image}->string( font  => $self->{fonts}{header}, text  => $title,
			     x => 50, y => 50, color => $colours{black}, aa => 1);
  }
  return;
}


sub add_legend {
  my $Chart = shift;
  my $starty = 490;
  my $endy = 470 - (scalar @{$Chart->{records}} * 18);
  $Chart->{_image}->box( color=>$colours{black},xmin=>45,ymin=>$endy,
			 xmax=>250,ymax=>$starty+2,filled=>0);
  $Chart->{_image}->string( font  => $Chart->{fonts}{label}, text  => "Legend :",
			    x => 50, y => $endy+19, color => $colours{black}, aa => 1);
  foreach my $record (@{$Chart->{records}}) {
    $Chart->{_image}->string( font  => $Chart->{fonts}{label}, 
			      text  => "$record->{Label} : $record->{Colour}",

Radial.pm  view on Meta::CPAN

=item use Imager::Chart::Radial;

=item my $chart = Radial->new(axis => \@axis, fonts => \%fonts);

=item $chart->plot_axis();

=item $chart->plot_values( \@records );>

=item $chart->add_title("This is a chart, there are many like it but this is mine");>

=item $chart->add_legend();>

=item $chart->print('mychart.png');

=head1 DESCRIPTION

This module uses Imager to plot and output Radial or Radar charts.

=head1 ABOUT

I originally wrote a radial chart creator based on GD, but the GD library did not provide anti-aliasing and sufficient colours for a clean looking image until relatively recently. I wrote this version because I wanted to learn Imager and also provide...

Radial.pm  view on Meta::CPAN

                     { Label => "Baz", Colour => "green", Values => {
                         "Reliability"=>7,"Ease of Use"=>2,"Response Speed"=>9,"Information"=>8,
                         "Layout"=>3,"Navigation"=>4,"Organisation"=>6,"Searching"=>3,
                         },
                    },
            );


=head2 Labelling the graph

You can add a title and a legend to the chart using add_title and add_legend

$chart->add_title("This is a radial chart using Imager and my own values");

The title should be short and uses the font specified as header in the fonts hash.

$chart->add_legend();

The legend is generated from the records, you must therefore plot the graph before adding the legend. The legend uses the label font.

=head2 Outputing the graph

To write out the graph just call the print method with the filename you wish to write to.

$chart->print('newchart.png');

=head1 SEE ALSO

Imager



( run in 0.880 second using v1.01-cache-2.11-cpan-49f99fa48dc )