3 use Imager::Graph::Bar;
5 use Imager::Font::Test;
7 use Imager::Graph::Test 'cmpimg';
10 or mkdir "testout", 0700
11 or die "Could not create output directory: $!";
16 local $SIG{__WARN__} =
23 use Imager qw(:handy);
27 #my $fontfile = 'ImUgly.ttf';
28 #my $font = Imager::Font->new(file=>$fontfile, type => 'ft2', aa=>1)
29 # or plan skip_all => "Cannot create font object: ",Imager->errstr,"\n";
30 my $font = Imager::Font::Test->new();
32 my @data = (1 .. 1000);
34 my $bar = Imager::Graph::Bar->new();
35 ok($bar, "creating bar chart object");
37 $bar->add_data_series(\@data);
39 my $img1 = $bar->draw();
40 ok($img1, "drawing bar chart");
42 $img1->write(file=>'testout/t34_points.ppm') or die "Can't save img1: ".$img1->errstr."\n";
43 cmpimg($img1, 'testimg/t34_points.ppm', 80_000);
45 unless (is(@warned, 0, "should be no warnings")) {