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
|
#!/usr/bin/perl -w
# $Id: graph,v 1.2 2002/07/27 20:12:08 tom Exp $
#
# Purpose:
# To demonstrate the Perl5 Cdk Graph Widget.
#
# 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();
|