From 14d9d787bbe977f383896cb916147d5391ca32da Mon Sep 17 00:00:00 2001 From: Christian Ledermann Date: Thu, 22 Aug 2013 19:32:58 +0300 Subject: [PATCH] add inner_radius for piechart fixes #42 does not work for Multi-series pies --- pygal/config.py | 4 ++++ pygal/graph/pie.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pygal/config.py b/pygal/config.py index 59a76a1..ff189d4 100644 --- a/pygal/config.py +++ b/pygal/config.py @@ -173,6 +173,10 @@ class Config(object): tooltip_border_radius = Key(0, int, "Look", "Tooltip border radius") + inner_radius = Key( + 0, float, "Look", "Piechart inner radius (donut), must be <.9") + + ############ Label ############ x_labels = Key( None, list, "Label", diff --git a/pygal/graph/pie.py b/pygal/graph/pie.py index dc756a9..b709b90 100644 --- a/pygal/graph/pie.py +++ b/pygal/graph/pie.py @@ -59,7 +59,7 @@ class Pie(Graph): big_radius = radius else: big_radius = radius * .9 - small_radius = 0 + small_radius = radius * self.config.inner_radius self.svg.slice( serie_node, slice_, big_radius, small_radius,