pie.t
上传用户:shbosideng
上传日期:2013-05-04
资源大小:1555k
文件大小:1k
- use lib './t';
- use strict;
- use GIFgraph::pie;
- $::WRITE = 0;
- require 'ff.pl';
- my @data = (
- ["1st","2nd","3rd","4th","5th","6th"],
- [ 1, 2, 5, 6, 3, 1.5],
- );
- my @opts = (
- {},
- {
- 'start_angle' => 90,
- 'title' => 'A pie chart',
- 'label' => 'Just data',
- },
- );
- print "1..1n";
- ($::WARN) && warn "n";
- foreach my $i (1)
- {
- my $fn = 't/pie' . $i . '.gif';
- my $checkImage = get_test_data($fn);
- my $opts = $opts[$i];
- my $g = new GIFgraph::pie( );
- $g->set( %$opts );
- my $Image = $g->plot( @data );
- print (($checkImage eq $Image ? "ok" : "not ok"). " $in");
- ($::WARN) && warn (($checkImage eq $Image ? "ok" : "not ok"). " $in");
- write_file($fn, $Image) if ($::WRITE);
- }