| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
1477
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
27
|
|
|
2
|
1
|
|
|
1
|
|
24
|
use GD::Graph::bars; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use GD::Graph::hbars; |
|
4
|
|
|
|
|
|
|
use GD::Graph::Data; |
|
5
|
|
|
|
|
|
|
require 'save.pl'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$GD::Graph::Error::Debug = 5; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $data = GD::Graph::Data->new( |
|
10
|
|
|
|
|
|
|
[ |
|
11
|
|
|
|
|
|
|
["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"], |
|
12
|
|
|
|
|
|
|
[ 5, 12, 24, 33, 19, 8, 6, 15, 21], |
|
13
|
|
|
|
|
|
|
[ 1, 2, 5, 6, 3, 1.5, 1, 3, 4], |
|
14
|
|
|
|
|
|
|
] |
|
15
|
|
|
|
|
|
|
) or die GD::Graph::Data->error; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $values = $data->copy(); |
|
18
|
|
|
|
|
|
|
$values->set_y(1, 7, undef) or warn $data->error; |
|
19
|
|
|
|
|
|
|
$values->set_y(2, 7, undef) or warn $data->error; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my @names = qw/sample14 sample14-h/; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $path = $ENV{GDGRAPH_SAMPLES_PATH} ? $ENV{GDGRAPH_SAMPLES_PATH} : ''; |
|
24
|
|
|
|
|
|
|
for my $my_graph (GD::Graph::bars->new(600,400), |
|
25
|
|
|
|
|
|
|
GD::Graph::hbars->new(600,400)) |
|
26
|
|
|
|
|
|
|
{ |
|
27
|
|
|
|
|
|
|
my $name = shift @names; |
|
28
|
|
|
|
|
|
|
print STDERR "Processing $name\n"; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$my_graph->set( |
|
31
|
|
|
|
|
|
|
x_label => 'x label', |
|
32
|
|
|
|
|
|
|
y1_label => 'y1 label', |
|
33
|
|
|
|
|
|
|
y2_label => 'y2 label', |
|
34
|
|
|
|
|
|
|
title => 'Using two axes', |
|
35
|
|
|
|
|
|
|
y1_max_value => 40, |
|
36
|
|
|
|
|
|
|
y2_max_value => 8, |
|
37
|
|
|
|
|
|
|
y_tick_number => 8, |
|
38
|
|
|
|
|
|
|
y_label_skip => 2, |
|
39
|
|
|
|
|
|
|
long_ticks => 1, |
|
40
|
|
|
|
|
|
|
two_axes => 1, |
|
41
|
|
|
|
|
|
|
legend_placement => 'RT', |
|
42
|
|
|
|
|
|
|
x_label_position => 1/2, |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
bgclr => 'white', |
|
45
|
|
|
|
|
|
|
fgclr => 'white', |
|
46
|
|
|
|
|
|
|
boxclr => 'dblue', |
|
47
|
|
|
|
|
|
|
accentclr => 'dblue', |
|
48
|
|
|
|
|
|
|
valuesclr => '#ffff77', |
|
49
|
|
|
|
|
|
|
dclrs => [qw(lgreen lred)], |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
bar_spacing => 1, |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
logo => "${path}logo." . GD::Graph->export_format, |
|
54
|
|
|
|
|
|
|
logo_position => 'BR', |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
transparent => 0, |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
l_margin => 10, |
|
59
|
|
|
|
|
|
|
b_margin => 10, |
|
60
|
|
|
|
|
|
|
r_margin => 10, |
|
61
|
|
|
|
|
|
|
t_margin => 10, |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
show_values => 1, |
|
64
|
|
|
|
|
|
|
values_format => "%4.1f", |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
) or warn $my_graph->error; |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
if ($name =~ /-h$/) |
|
69
|
|
|
|
|
|
|
{ |
|
70
|
|
|
|
|
|
|
$my_graph->set(x_labels_vertical => 0, values_vertical => 0); |
|
71
|
|
|
|
|
|
|
$my_graph->set_legend('bottom axis', 'top axis'); |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
else |
|
74
|
|
|
|
|
|
|
{ |
|
75
|
|
|
|
|
|
|
$my_graph->set(x_labels_vertical => 1, values_vertical => 1); |
|
76
|
|
|
|
|
|
|
$my_graph->set_legend('left axis', 'right axis'); |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my $font_spec = "../Dustismo_Sans"; |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
$my_graph->set_y_label_font($font_spec, 12); |
|
82
|
|
|
|
|
|
|
$my_graph->set_x_label_font($font_spec, 12); |
|
83
|
|
|
|
|
|
|
$my_graph->set_y_axis_font($font_spec, 10); |
|
84
|
|
|
|
|
|
|
$my_graph->set_x_axis_font($font_spec, 10); |
|
85
|
|
|
|
|
|
|
$my_graph->set_title_font($font_spec, 18); |
|
86
|
|
|
|
|
|
|
$my_graph->set_legend_font($font_spec, 8); |
|
87
|
|
|
|
|
|
|
$my_graph->set_values_font($font_spec, 8); |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
$my_graph->plot($data) or die $my_graph->error; |
|
90
|
|
|
|
|
|
|
save_chart($my_graph, $name); |
|
91
|
|
|
|
|
|
|
} |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |