File: synopsis_heatmap.pl

package info (click to toggle)
libsvg-tt-graph-perl 1.04-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 488 kB
  • sloc: perl: 5,717; makefile: 7
file content (51 lines) | stat: -rw-r--r-- 1,009 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
43
44
45
46
47
48
49
50
51
use lib qw(../lib);
use SVG::TT::Graph::HeatMap;
use Data::Dumper;

my @data_cpu1;
my $x_size = 10;


for ( 1 .. 20 )
{
    push @data,
      { x   => "ABC$_",
        c   => $_ * 30,
        b   => $_ * 20,
        d   => int( rand(1000) ),
        absasasc => $_,
        f   => int( rand(1000) ),
        e   => int( rand(100) ),
      };
}




my %ylabs = %{ $data[0] };
delete $ylabs{ x };


my $graph = SVG::TT::Graph::HeatMap->new(
                                  { block_height => 24,
                                    block_width  => 24,
                                    gutter_width => 1,
                                    y_axis_order => [reverse sort keys %ylabs],
                                    rotate_x_labels => 0,
                                    debug           => 0,
                                  } );

$graph->add_data(
                  { 'data'  => \@data,
                    'title' => 'CPU',
                  } );

$graph->tidy(1);

print $graph->burn();


1;