Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (43 sloc) 1.253 kb
f78bc6a Cory G Watson Initial import.
authored
1 #!/usr/bin/perl
2 use strict;
3
4 use Chart::Clicker;
5 use Chart::Clicker::Context;
6 use Chart::Clicker::Data::DataSet;
7 use Chart::Clicker::Data::Marker;
8 use Chart::Clicker::Data::Series;
9 use Geometry::Primitive::Rectangle;
10 use Chart::Clicker::Renderer::Point;
11 use Graphics::Color::RGB;
12 use Geometry::Primitive::Circle;
13
f3d663c Cory G Watson Bubble & point
authored
14 my $cc = Chart::Clicker->new(width => 500, height => 250, format => 'png');
f78bc6a Cory G Watson Initial import.
authored
15
16 my @hours = qw(
17 1 2 3 4 5 6 7 8 9 10 11 12
18 );
19 my @bw1 = qw(
20 5.8 5.0 4.9 4.8 4.5 4.25 3.5 2.9 2.5 1.8 .9 .8
21 );
22 my @bw2 = qw(
23 .7 1.1 1.7 2.5 3.0 4.5 5.0 4.9 4.7 4.8 4.2 4.4
24 );
25 my @bw3 = qw(
26 .3 1.4 1.2 1.5 4.0 3.5 2.0 1.9 2.7 4.2 3.2 1.1
27 );
28
29 my $series1 = Chart::Clicker::Data::Series->new(
30 keys => \@hours,
31 values => \@bw1,
32 );
33 my $series2 = Chart::Clicker::Data::Series->new(
34 keys => \@hours,
35 values => \@bw2,
36 );
37
38 my $series3 = Chart::Clicker::Data::Series->new(
39 keys => \@hours,
40 values => \@bw3,
41 );
42
5e82ba7 Cory G Watson bubble & point titles
authored
43 $cc->title->text('Point');
44 $cc->title->padding->bottom(5);
f78bc6a Cory G Watson Initial import.
authored
45
46 my $ds = Chart::Clicker::Data::DataSet->new(series => [ $series1, $series2, $series3 ]);
47
48 $cc->add_to_datasets($ds);
49
50 my $defctx = $cc->get_context('default');
51
52 $defctx->renderer(Chart::Clicker::Renderer::Point->new);
53
f3d663c Cory G Watson Bubble & point
authored
54 $cc->write_output('point.png');
Something went wrong with that request. Please try again.