On Thu May 03 19:27:04 2012, cpan@punch.net wrote:
Show quoted text> The current code does not allow setting the border to 0, attached is a
> patch that will allow this.
During my testing, it looks like chrome browser will still draw a border
if the stroke-width is set to zero, so this additional patch removes the
setting of stroke-width if there is no borderwidth set.
diff -Naur SVGGraph-Pie-0.05.orig//lib/SVGGraph/Pie.pm SVGGraph-Pie-0.05/lib/SVGGraph/Pie.pm
--- SVGGraph-Pie-0.05.orig//lib/SVGGraph/Pie.pm 2003-07-27 18:34:34.000000000 -0700
+++ SVGGraph-Pie-0.05/lib/SVGGraph/Pie.pm 2012-05-03 17:11:11.000000000 -0700
@@ -89,15 +89,18 @@
}
## Draw circle
+ my $circlestyle = {'fill-opacity' => 0};
+ if ( $borderwidth )
+ {
+ $circlestyle->{stroke} = 'black';
+ $circlestyle->{'stroke-width'} = $borderwidth;
+ }
+
$svg->circle(
cx => $cx,
cy => $cy,
r => $radius,
- style => {
- 'stroke' => 'black',
- 'stroke-width' => $borderwidth,
- 'fill-opacity' => 0,
- },
+ style => $circlestyle,
);
## Draw separater
@@ -107,15 +110,18 @@
my $separator_y = pop(@separator_lines);
my $separator_x = pop(@separator_lines);
my $g = $pie->tag('g', id => "line_$i", transform => "rotate($start)");
+ my $linestyle = {};
+ if ( $borderwidth )
+ {
+ $linestyle->{stroke} = 'black';
+ $linestyle->{'stroke-width'} = $borderwidth;
+ }
$g->line(
x1 => 0,
y1 => 0,
x2 => $separator_x,
y2 => $separator_y,
- style => {
- 'stroke' => 'black',
- 'stroke-width' => $borderwidth
- },
+ style => $linestyle,
);
}