Browse Source

Merge pull request #176 from djt/master

Add ability to edit single margins
pull/158/merge
Mounier Florian 10 years ago
parent
commit
e623bc90fe
  1. 16
      pygal/config.py
  2. 5
      pygal/graph/base.py

16
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(

5
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:

Loading…
Cancel
Save