File Coverage

samples/sample53.pl
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1 1     1   1511 use GD::Graph::lines;
  0            
  0            
2             use GD::Graph::colour;
3             use GD::Graph::Data;
4             require 'save.pl';
5              
6             my $path = $ENV{GDGRAPH_SAMPLES_PATH} ? $ENV{GDGRAPH_SAMPLES_PATH} : '';
7              
8             GD::Graph::colour::read_rgb("${path}rgb.txt") or
9             die "Cannot read colours from ${path}rgb.txt";
10              
11             print STDERR "Processing sample53\n";
12              
13             $data = ([
14             ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
15             [ 1, 2, 5, 6, 3, 1.5, -1, -3, -4],
16             [ -4, -3, 1, 1, -3, -1.5, -2, -1, 0],
17             [ 9, 8, 9, 8.4, 7.1, 7.5, 8, 3, -3],
18             [ 0.1, 0.0, -0.3, -0.4, 0.1, 0.5, 0.1, 0, 0.4],
19             ]);
20              
21             $my_graph = new GD::Graph::lines();
22              
23             $my_graph->set(
24             x_label => 'X Label',
25             y_label => 'Y label',
26             title => 'A Multiple Line Graph',
27             y_max_value => 10,
28             y_min_value => -5,
29             y_tick_number => 3,
30             y_label_skip => 1,
31             zero_axis_only => 0,
32             long_ticks => 1,
33             x_ticks => 0,
34             dclrs => [ qw( darkorchid2 mediumvioletred deeppink darkturquoise ) ],
35             line_types => [ 1, 2, 3, 4 ],
36             line_type_scale => 8,
37             legend_marker_width => 24,
38             line_width => 3,
39              
40             show_values => 1,
41              
42             transparent => 0,
43              
44             ) or warn $my_graph->error;
45              
46             $my_graph->set_legend( 'one', 'two', undef, 'four' );
47             $my_graph->plot($data) or die $my_graph->error;
48             save_chart($my_graph, 'sample53');
49              
50              
51             1;