Skip to content

Commit

Permalink
move pie & candlestick
Browse files Browse the repository at this point in the history
  • Loading branch information
gphat committed Nov 26, 2009
1 parent 5e82ba7 commit befde56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
File renamed without changes.
28 changes: 6 additions & 22 deletions pie.pl → pie/pie.pl
Expand Up @@ -10,7 +10,7 @@
use Geometry::Primitive::Rectangle;
use Graphics::Color::RGB;

my $cc = Chart::Clicker->new(width => 500, height => 400, format => 'pdf');
my $cc = Chart::Clicker->new(width => 300, height => 250, format => 'png');

my $series1 = Chart::Clicker::Data::Series->new(
keys => [ 1, 2, 3 ],
Expand All @@ -24,37 +24,21 @@
keys => [ 1, 2, 3],
values => [ 1, 1, 0 ],
);
$cc->background_color(
Graphics::Color::RGB->new(red => .95, green => .94, blue => .92)
);

$cc->border->width(0);
my $grey = Graphics::Color::RGB->new(
red => .36, green => .36, blue => .36, alpha => 1
);
my $moregrey = Graphics::Color::RGB->new(
red => .71, green => .71, blue => .71, alpha => 1
);
my $orange = Graphics::Color::RGB->new(
red => .88, green => .48, blue => .09, alpha => 1
);
$cc->color_allocator->colors([ $grey, $moregrey, $orange ]);

$cc->legend->font->family('Hoefler Text');
$cc->title->text('Pie');
$cc->title->padding->bottom(5);

my $ds = Chart::Clicker::Data::DataSet->new(series => [ $series1, $series2, $series3 ]);

$cc->add_to_datasets($ds);

my $defctx = $cc->get_context('default');
my $pie = Chart::Clicker::Renderer::Pie->new;
$pie->brush->width(6);
$pie->border_color(Graphics::Color::RGB->new(red => .95, green => .94, blue => .92));
$pie->brush->width(3);
$pie->border_color(Graphics::Color::RGB->new(red => 1, green => 1, blue => 1));
$defctx->renderer($pie);
$defctx->domain_axis->hidden(1);
$defctx->range_axis->hidden(1);
$cc->plot->grid->visible(0);
$cc->legend->font->size(16);

$cc->draw;
$cc->write('foo.pdf');
$cc->write_output('pie.png');
Binary file added pie/pie.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit befde56

Please sign in to comment.