From 8af2e77cb468303b5dbfdb22534b3bbd28fdaa2f Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Wed, 24 Jun 2015 11:02:13 +0200 Subject: [PATCH] Reverse horizontal series. Fix #229 Second edition --- pygal/graph/bar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pygal/graph/bar.py b/pygal/graph/bar.py index 5cf7543..5ba98b8 100644 --- a/pygal/graph/bar.py +++ b/pygal/graph/bar.py @@ -43,7 +43,12 @@ class Bar(Graph): x += series_margin width -= 2 * series_margin width /= self._order - x += serie.index * width + if self.horizontal: + serie_index = self._order - serie.index - 1 + else: + serie_index = serie.index + x += serie_index * width + serie_margin = width * self._serie_margin x += serie_margin width -= 2 * serie_margin