File: bars_5.t

package info (click to toggle)
libchart-perl 2.4.10ds1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,900 kB
  • ctags: 245
  • sloc: perl: 11,697; makefile: 6
file content (43 lines) | stat: -rw-r--r-- 695 bytes parent folder | download | duplicates (4)
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
43
#!/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);