File: bars_5.t

package info (click to toggle)
libchart-perl 2.4.1-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,804 kB
  • ctags: 370
  • sloc: perl: 9,120; makefile: 532
file content (42 lines) | stat: -rwxr-xr-x 744 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
#!/usr/bin/perl -w

use Chart::Bars;
use strict;

print "1..1\n";

my (@data, @labels, %hash, $g, $hits);

# create an array of labels
for (1..49) {
  push (@labels, $_);
}

# create an array of data
for (1..49) {
  srand(time() /$_ );
  $hits = int(rand(100)+401)  ;
  push (@data, $hits);
}


$g = Chart::Bars->new(700,300);
$g->add_dataset(@labels);
$g->add_dataset(@data);

%hash =(
          'legend' => 'none',
          'precision' => 0,
          'x_ticks' => 'vertical',
          'title' => 'Lottozahlenverteilung',
          'y_label' => 'Hufigkeit',
          'y_grid_lines' => 'true',
          
          );

$g->set ( %hash);
$g->png ("samples/bars_5.png");
print "ok 1\n";

exit (0);