diff --git a/candlestick.pl b/candlestick/candlestick.pl similarity index 100% rename from candlestick.pl rename to candlestick/candlestick.pl diff --git a/pie.pl b/pie/pie.pl similarity index 54% rename from pie.pl rename to pie/pie.pl index 6fd60a4..851bceb 100644 --- a/pie.pl +++ b/pie/pie.pl @@ -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 ], @@ -24,23 +24,9 @@ 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 ]); @@ -48,13 +34,11 @@ 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'); diff --git a/pie/pie.png b/pie/pie.png new file mode 100644 index 0000000..4f90059 Binary files /dev/null and b/pie/pie.png differ