3 use Imager::Graph::Line;
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();
33 my @labels = qw(alpha beta gamma delta epsilon phi gi);
35 my $line = Imager::Graph::Line->new();
36 ok($line, "creating line chart object");
38 $line->set_font($font);
39 $line->add_data_series(\@data);
40 $line->set_labels(\@labels);
41 $line->use_automatic_axis();
45 my $img1 = $line->draw(outline => {line => '#FF0000'});
46 ok($img1, "drawing line chart");
48 $img1->write(file=>'testout/t31tic_color.ppm') or die "Can't save img1: ".$img1->errstr."\n";
50 eval { require Chart::Math::Axis; };
52 cmpimg($img1, 'testimg/t31tic_color.ppm', 100_000);
55 cmpimg($img1, 'testimg/t31tic_color_CMA.ppm', 100_000);
58 unless (is(@warned, 0, "should be no warnings")) {