File: test2.t

package info (click to toggle)
libchart-strip-perl 1.08-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 212 kB
  • sloc: perl: 1,105; makefile: 6
file content (35 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

use Chart::Strip;
my $n = 1;

print "1..5\n";

my $c = Chart::Strip->new();

my $data;
for(my $t=10; $t<210; $t++){
    my $v = ($t % 20) ? .25 : 1;
    push @$data, {
        time  => $^T + $t  * 5000,
        value => $v + $t / 100 - 1.5,
    };
}

$c->add_data( $data, {style => 'line', color => 'FF0000'} );

my $p = $c->png();

t( $p );
t( $c->{margin_bottom} == 20 );
t( $c->{margin_left} == 34 );
t( $c->{yd_max} == 1.5 );
t( $c->{yd_min} == -1.15 );

sub t {
    my $x = shift;

    print "not " unless $x;
    print "ok $n\n";
    $n ++;
}