Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Imager::Graph::StackedUsermContributed Perl DocImager::Graph::StackedColumn(3)

NAME
	 Imager::Graph::StackedColumn -	a tool for drawing stacked column charts on Imager images

SYNOPSIS
	 use Imager::Graph::StackedColumn;
	 use Imager::Font;

	 my $font = Imager::Font->new(file => '/path/to/font.ttf') || die "Error: $!";

	 my $graph = Imager::Graph::StackedColumn->new();
	 $graph->set_image_width(900);
	 $graph->set_image_height(600);
	 $graph->set_font($font);
	 $graph->use_automatic_axis();
	 $graph->show_legend();

	 my @data = (1,	2, 3, 5, 7, 11);
	 my @data2 = (1, 1, 1, 2, 2, 2);
	 my @labels = qw(one two three five seven eleven);

	 $graph->add_data_series(\@data, 'Primes');
	 $graph->add_data_series(\@data2, 'Numbers');
	 $graph->set_labels(\@labels);

	 my $img = $graph->draw() || die $graph->error;

	 $img->write(file => 'columns.png');

perl v5.32.0			  2012-05-04   Imager::Graph::StackedColumn(3)

NAME | SYNOPSIS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Imager::Graph::StackedColumn&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help