From: Tony Cook Date: Mon, 21 Apr 2008 08:57:27 +0000 (+0000) Subject: - round the pie radius down to avoid running over the edge of the X-Git-Tag: v0.06~1 X-Git-Url: http://git.imager.perl.org/imager-graph.git/commitdiff_plain/320f5a49d2e67d66683d6f8f1e257fde3f1e2b2e - round the pie radius down to avoid running over the edge of the image - changed the pie maxsegments default to 0.01 from 0.05 - removed the obsolete pie blur style information - documented some of the pie chart specific style settings - changed the default drop shadow style to a translucent fill so the background can show through. --- diff --git a/Changes b/Changes index 0965c96..26a3870 100644 --- a/Changes +++ b/Changes @@ -21,6 +21,15 @@ Imager-Graph 0.06 - unreleased - round the pie radius down to avoid running over the edge of the image + - changed the pie maxsegments default to 0.01 from 0.05 + + - removed the obsolete pie blur style information + + - documented some of the pie chart specific style settings + + - changed the default drop shadow style to a translucent fill so the + background can show through. + Imager-Graph 0.05 - 17 December 2007 ================= diff --git a/Graph.pm b/Graph.pm index 68d938a..2aa2c77 100644 --- a/Graph.pm +++ b/Graph.pm @@ -657,7 +657,7 @@ my %style_defs = pconlyformat => sub { sprintf "%.1f%%", $_[0] }, }, dropshadow => { - fill => '404040', + fill => { solid => Imager::Color->new(0, 0, 0, 96) }, off => 'scale(0.4,text.size)', offx => 'lookup(dropshadow.off)', offy => 'lookup(dropshadow.off)', diff --git a/lib/Imager/Graph/Pie.pm b/lib/Imager/Graph/Pie.pm index 72c8322..b9aa3db 100644 --- a/lib/Imager/Graph/Pie.pm +++ b/lib/Imager/Graph/Pie.pm @@ -87,6 +87,59 @@ the pie is given a drop shadow. =back +=head1 PIE CHART STYLES + +The following style values are specific to pie charts: + +Controlling callouts, the C option: + +=over + +=item * + +color - the color of the callout line and the callout text. + +=item * + +font, size - font and size of the callout text + +=item * + +outside - the distance the radial callout line goes outside the pie + +=item * + +leadlen - the length of the horizontal callout line from the end of +the radial line. + +=item * + +gap - the distance between the end of the horizontal callout line and +the label. + +=item * + +inside - the length of the radial callout line within the pie. + +=back + +The outline, line option controls the color of the pie segment +outlines, if enabled with the C feature. + +Under C: + +=over + +=item * + +maxsegment - any segment below this fraction of the total of the +segments will be put into the "others" segment. Default: 0.01 + +=back + +The top level C setting controls the label for the +"others" segment, default "(others)". + =head1 EXAMPLES Assuming: @@ -481,16 +534,11 @@ sub _style_defs { my %work = %{$self->SUPER::_style_defs()}; $work{otherlabel} = "(others)"; - $work{features}{pieblur} = 1; $work{pie} = { - blur => { - type=>'conv', - coef=>[0.05, 0.1, 0.3, 1, 0.3, 0.1, 0.05] - }, guessfactor=>0.6, size=>0.8, - maxsegment=> 0.05, + maxsegment=> 0.01, }; \%work; diff --git a/testimg/t10_hlegend.png b/testimg/t10_hlegend.png index 7844d2f..e0789bc 100644 Binary files a/testimg/t10_hlegend.png and b/testimg/t10_hlegend.png differ diff --git a/testimg/t10_lin_fount.png b/testimg/t10_lin_fount.png index b93620d..80d1b99 100644 Binary files a/testimg/t10_lin_fount.png and b/testimg/t10_lin_fount.png differ