]> git.imager.perl.org - imager-graph.git/blame - t/t13stacked_col.t
hoist line marker drawing into the base class
[imager-graph.git] / t / t13stacked_col.t
CommitLineData
2eac77fc 1#!perl -w
2use strict;
3use Imager::Graph::StackedColumn;
4use lib 't/lib';
5use Imager::Font::Test;
6use Test::More;
7
8-d 'testout'
9 or mkdir "testout", 0700
10 or die "Could not create output directory: $!";
11
12++$|;
13
14use Imager qw(:handy);
15
28acfd43 16plan tests => 3;
17
18my @warned;
19local $SIG{__WARN__} =
20 sub {
21 print STDERR $_[0];
22 push @warned, $_[0]
23 };
24
2eac77fc 25
26#my $fontfile = 'ImUgly.ttf';
27#my $font = Imager::Font->new(file=>$fontfile, type => 'ft2', aa=>1)
28# or plan skip_all => "Cannot create font object: ",Imager->errstr,"\n";
29my $font = Imager::Font::Test->new();
30
31my @data = ( 100, 180, 80, 20, 2, 1, 0.5 );
32my @labels = qw(alpha beta gamma delta epsilon phi gi);
33
34my $stacked_col = Imager::Graph::StackedColumn->new();
35ok($stacked_col, "creating stacked_col chart object");
36
37$stacked_col->add_data_series(\@data);
38$stacked_col->set_labels(\@labels);
39
40my $img1 = $stacked_col->draw();
41ok($img1, "drawing stacked_col chart");
42
43$img1->write(file=>'testout/t13_basic.ppm') or die "Can't save img1: ".$img1->errstr."\n";
44
45
28acfd43 46unless (is(@warned, 0, "should be no warnings")) {
47 diag($_) for @warned;
48}