2eac77fc |
1 | #!perl -w |
2 | use strict; |
3 | use Imager::Graph::Column; |
4 | use lib 't/lib'; |
5 | use Imager::Font::Test; |
6 | use Test::More; |
7 | |
8 | -d 'testout' |
9 | or mkdir "testout", 0700 |
10 | or die "Could not create output directory: $!"; |
11 | |
12 | ++$|; |
13 | |
14 | use Imager qw(:handy); |
15 | |
16 | plan tests => 2; |
17 | |
18 | #my $fontfile = 'ImUgly.ttf'; |
19 | #my $font = Imager::Font->new(file=>$fontfile, type => 'ft2', aa=>1) |
20 | # or plan skip_all => "Cannot create font object: ",Imager->errstr,"\n"; |
21 | my $font = Imager::Font::Test->new(); |
22 | |
23 | my @data = ( 100, 180, 80, 20, 2, 1, 0.5 ); |
24 | my @labels = qw(alpha beta gamma delta epsilon phi gi); |
25 | |
26 | my $column = Imager::Graph::Column->new(); |
27 | ok($column, "creating column chart object"); |
28 | |
29 | $column->add_data_series(\@data); |
30 | $column->set_labels(\@labels); |
31 | |
32 | my $img1 = $column->draw(); |
33 | ok($img1, "drawing column chart"); |
34 | |
35 | $img1->write(file=>'testout/t12_basic.ppm') or die "Can't save img1: ".$img1->errstr."\n"; |
36 | |
37 | |