diff --git a/pygal/graph/line.py b/pygal/graph/line.py index da03c90..77ed8b8 100644 --- a/pygal/graph/line.py +++ b/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) diff --git a/pygal/graph/radar.py b/pygal/graph/radar.py index 07666bd..e04ddfa 100644 --- a/pygal/graph/radar.py +++ b/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)) diff --git a/pygal/svg.py b/pygal/svg.py index d377062..a93d499 100644 --- a/pygal/svg.py +++ b/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: