3 use Imager::Graph::Column;
5 use Imager::Font::Test;
9 or mkdir "testout", 0700
10 or die "Could not create output directory: $!";
14 use Imager qw(:handy);
19 local $SIG{__WARN__} =
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";
29 my $font = Imager::Font::Test->new();
31 my @data = ( 100, 180, 80, 20, 2, 1, 0.5 );
32 my @labels = qw(alpha beta gamma delta epsilon phi gi);
34 my $column = Imager::Graph::Column->new();
35 ok($column, "creating column chart object");
37 $column->add_data_series(\@data);
38 $column->set_labels(\@labels);
40 my $img1 = $column->draw();
41 ok($img1, "drawing column chart");
43 $img1->write(file=>'testout/t12_basic.ppm') or die "Can't save img1: ".$img1->errstr."\n";
45 unless (is(@warned, 0, "should be no warnings")) {