line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
2603
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
2
|
1
|
|
|
1
|
|
33
|
use GD::Graph::bars; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use GD::Graph::hbars; |
4
|
|
|
|
|
|
|
require 'save.pl'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my @data = ( |
7
|
|
|
|
|
|
|
[ qw( 1st 2nd 3rd 4th 5th 6th 7th 8th 9th ) ], |
8
|
|
|
|
|
|
|
[ 5, 12,undef, 33, 19, 8, 5, 15, 21], |
9
|
|
|
|
|
|
|
[ -6, -5, -9, -8, -11, -9.3,undef, -9, -12] |
10
|
|
|
|
|
|
|
); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $refit = 4; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub y_format |
15
|
|
|
|
|
|
|
{ |
16
|
|
|
|
|
|
|
my $value = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
if ($value < 0) |
19
|
|
|
|
|
|
|
{ |
20
|
|
|
|
|
|
|
return sprintf('-$%3d', abs($value) * $refit); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
return sprintf('$%3d', $value * $refit); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my @names = qw/sample16 sample16-h/; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
for my $my_graph (GD::Graph::bars->new, GD::Graph::hbars->new) |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
my $name = shift @names; |
30
|
|
|
|
|
|
|
print STDERR "Processing $name\n"; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$my_graph->set( |
33
|
|
|
|
|
|
|
x_label => 'Day', |
34
|
|
|
|
|
|
|
y_label => 'AUD', |
35
|
|
|
|
|
|
|
title => 'Credits and Debits', |
36
|
|
|
|
|
|
|
y_max_value => 35, |
37
|
|
|
|
|
|
|
y_min_value => -15, |
38
|
|
|
|
|
|
|
y_tick_number => 10, |
39
|
|
|
|
|
|
|
y_label_skip => 2, |
40
|
|
|
|
|
|
|
overwrite => 1, |
41
|
|
|
|
|
|
|
dclrs => [ qw( green lred ) ], |
42
|
|
|
|
|
|
|
axislabelclr => 'black', |
43
|
|
|
|
|
|
|
legend_placement => 'RB', |
44
|
|
|
|
|
|
|
zero_axis_only => 0, |
45
|
|
|
|
|
|
|
y_number_format => \&y_format, |
46
|
|
|
|
|
|
|
x_label_position => 1/2, |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
transparent => 0, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$my_graph->set_legend( 'credits', 'debets' ); |
52
|
|
|
|
|
|
|
$my_graph->plot(\@data); |
53
|
|
|
|
|
|
|
save_chart($my_graph, $name); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |