Browse Source

Fix /0

pull/8/head
Florian Mounier 13 years ago
parent
commit
da0cb8a5f6
  1. 2
      pygal/config.py
  2. 10
      pygal/graph/graph.py

2
pygal/config.py

@ -59,6 +59,8 @@ class Config(object):
y_label_rotation = 0
#: Set to false to remove legend
show_legend = True
#: Set to true to position legend at bottom
legend_at_bottom = True
#: Set to false to remove dots
show_dots = True
#: Size of legend boxes

10
pygal/graph/graph.py

@ -106,7 +106,7 @@ class Graph(BaseGraph):
axis = self.svg.node(self.nodes['plot'], class_="axis x")
truncation = self.truncate_label
if not truncation:
if self.x_label_rotation:
if self.x_label_rotation or len(self._x_labels) <= 1:
truncation = 25
else:
first_label_position = self.view.x(self._x_labels[0][1])
@ -214,10 +214,10 @@ class Graph(BaseGraph):
"""Make the title"""
if self.title:
self.svg.node(self.nodes['graph'], 'text', class_='title',
x=self.margin.left + self.view.width / 2,
y=self.title_font_size + 10
).text = truncate(self.title, int(reverse_text_len(
self.width, self.title_font_size)))
x=self.margin.left + self.view.width / 2,
y=self.title_font_size + 10
).text = truncate(self.title, int(reverse_text_len(
self.width, self.title_font_size)))
def _serie(self, serie):
"""Make serie node"""

Loading…
Cancel
Save