Browse Source

Fix encoding

pull/8/head
Florian Mounier 13 years ago
parent
commit
3e3c142e6b
  1. 8
      pygal/graph/line.py
  2. 2
      pygal/graph/radar.py
  3. 3
      pygal/svg.py

8
pygal/graph/line.py

@ -43,11 +43,11 @@ class Line(Graph):
def _compute(self):
if self.include_x_axis:
self._box.ymin = min(min(self.values), 0)
self._box.ymax = max(max(self.values), 0)
self._box.ymin = min(min(self._values), 0)
self._box.ymax = max(max(self._values), 0)
else:
self._box.ymin = min(self.values)
self._box.ymax = max(self.values)
self._box.ymin = min(self._values)
self._box.ymax = max(self._values)
x_step = len(self.series[0].values)
self._x_pos = [x / float(x_step - 1) for x in range(x_step)

2
pygal/graph/radar.py

@ -82,7 +82,7 @@ class Radar(Line):
def _compute(self):
self._box._margin *= 2
self._box.xmin = self._box.ymin = 0
self._box.xmax = self._box.ymax = self._rmax = max(self.values)
self._box.xmax = self._box.ymax = self._rmax = max(self._values)
x_step = len(self.series[0].values)
delta = 2 * pi / float(len(self.x_labels))

3
pygal/svg.py

@ -45,7 +45,7 @@ class Svg(object):
def add_style(self, css):
style = self.node(self.defs, 'style', type='text/css')
with open(css) as f:
style.text = template(
templ = template(
f.read(),
style=self.graph.style,
font_sizes=self.graph.font_sizes,
@ -54,6 +54,7 @@ class Svg(object):
if self.graph.fill else 0,
fill_opacity_hover=self.graph.style.opacity_hover
if self.graph.fill else 0)
style.text = templ.decode('utf-8')
def node(self, parent=None, tag='g', attrib=None, **extras):
if parent is None:

Loading…
Cancel
Save