File: graph

package info (click to toggle)
libcdk-perl 20240606-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,732 kB
  • sloc: perl: 6,146; sh: 3,599; makefile: 28
file content (43 lines) | stat: -rwxr-xr-x 736 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
# $Id: graph,v 1.3 2013/07/14 22:55:29 tom Exp $

#
# Purpose:
#	To demonstrate the Perl5 Cdk Graph Widget.

use strict;

#
# Load in the Cdk Extension.
#
use Cdk;
Cdk::init();

# Create the graph values.
my @values = qw (50 0 25 66 41 42 30 49 27);
my $chars  = "123456789";

# Create the graph object.
my $graph = new Cdk::Graph(
    'Title'  => "<C></3>Total Breakins",
    'Xtitle' => "<C></2>Count",
    'Ytitle' => '<C></5>Time Period',
    'Height' => -4,
    'Width'  => -4
);

# Load the object up.
$graph->set(
    'Values'     => \@values,
    'GraphChars' => $chars,
    'Box'        => "FALSE"
);

# Draw the graph.
$graph->draw();

# Wait until the user hits a key.
getc(STDIN);

# End Cdk.
Cdk::end();