From dd73b3bf4f983318a972b023597a639d17e9737f Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Mon, 6 Feb 2012 16:52:13 +0100 Subject: [PATCH] Fix shift --- pygal/line.py | 2 +- pygal/view.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pygal/line.py b/pygal/line.py index 16d04cc..166f5a7 100644 --- a/pygal/line.py +++ b/pygal/line.py @@ -47,7 +47,7 @@ class Line(BaseGraph): self.validate() x_step = len(self.series[0].values) x_pos = [x / float(x_step - 1) for x in range(x_step) - ] if x_step != 1 else [0] # Center if only one value + ] if x_step != 1 else [.5] # Center if only one value vals = [val for serie in self.series for val in serie.values] margin = Margin(*(4 * [10])) ymin, ymax = min(vals), max(vals) diff --git a/pygal/view.py b/pygal/view.py index 9be51cf..8cafd09 100644 --- a/pygal/view.py +++ b/pygal/view.py @@ -14,8 +14,6 @@ class View(object): self.height = height xrng = (xmax - xmin) or 1 yrng = (ymax - ymin) or 1 - if xrng == 1: - xmin -= .5 if yrng == 1: ymin -= .5 self.box = Box(xmin, ymin, xrng, yrng)