From 8676150aac2fae79f7e5e004ca95a47900dfcb98 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Fri, 5 Oct 2012 10:46:58 +0200 Subject: [PATCH] Bump 1.13.0 --- pygal/__init__.py | 2 +- pygal/graph/graph.py | 5 ++--- pygal/graph/xy.py | 7 +++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pygal/__init__.py b/pygal/__init__.py index 3af5136..9ec4e4c 100644 --- a/pygal/__init__.py +++ b/pygal/__init__.py @@ -21,7 +21,7 @@ Pygal - A python svg graph plotting library """ -__version__ = '0.12.2' +__version__ = '0.13.0' import sys from pygal.config import Config from pygal.ghost import Ghost diff --git a/pygal/graph/graph.py b/pygal/graph/graph.py index e30c0a4..a86fd60 100644 --- a/pygal/graph/graph.py +++ b/pygal/graph/graph.py @@ -101,8 +101,7 @@ class Graph(BaseGraph): a = self.svg.node(self.nodes['tooltip'], 'a') self.svg.node(a, 'rect', id="tooltip-box", - rx=5, ry=5, width=0, height=0 - ) + rx=5, ry=5, width=0, height=0) text = self.svg.node(a, 'text', class_='text') self.svg.node(text, 'tspan', class_='label') self.svg.node(text, 'tspan', class_='value') @@ -207,7 +206,7 @@ class Graph(BaseGraph): if not truncation: available_space = self.view.width / cols - ( self.legend_box_size + 5) - truncation = revesre_text_len( + truncation = reverse_text_len( available_space, self.legend_font_size) else: x = self.margin.left + self.view.width + 10 diff --git a/pygal/graph/xy.py b/pygal/graph/xy.py index da7eecb..6d6a06d 100644 --- a/pygal/graph/xy.py +++ b/pygal/graph/xy.py @@ -64,6 +64,13 @@ class XY(Line): yvals = [val[1] for serie in self.series for val in serie.interpolated] + if xvals: + xmin = min(xvals) + xmax = max(xvals) + rng = (xmax - xmin) + else: + rng = None + if rng: self._box.xmin, self._box.xmax = min(xvals), max(xvals) self._box.ymin, self._box.ymax = min(yvals), max(yvals)