diff --git a/pygal/config.py b/pygal/config.py index 2de0aa4..0f7c09b 100644 --- a/pygal/config.py +++ b/pygal/config.py @@ -242,6 +242,22 @@ class Config(CommonConfig): 20, int, "Look", "Margin around chart") + margin_top = Key( + 20, int, "Look", + "Margin around top of chart") + + margin_right = Key( + 20, int, "Look", + "Margin around right of chart") + + margin_bottom = Key( + 20, int, "Look", + "Margin around bottom of chart") + + margin_left = Key( + 20, int, "Look", + "Margin around left of chart") + tooltip_border_radius = Key(0, int, "Look", "Tooltip border radius") inner_radius = Key( diff --git a/pygal/graph/base.py b/pygal/graph/base.py index ff5ac22..d9d3e95 100644 --- a/pygal/graph/base.py +++ b/pygal/graph/base.py @@ -50,7 +50,10 @@ class BaseGraph(object): self._x_2nd_labels = None self._y_2nd_labels = None self.nodes = {} - self.margin = Margin(*([self.margin] * 4)) + self.margin = Margin(self.margin_top or self.margin, + self.margin_right or self.margin, + self.margin_bottom or self.margin, + self.margin_left or self.margin) self._box = Box() self.view = None if self.logarithmic and self.zero == 0: