Skip to content

Commit

Permalink
Fix x labels formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Aug 31, 2015
1 parent ae95223 commit 28037d9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/changelog.rst
Expand Up @@ -2,6 +2,12 @@
Changelog
=========

2.0.5
=====

* Fix x label formatting


2.0.4
=====

Expand Down
2 changes: 1 addition & 1 deletion pygal/__init__.py
Expand Up @@ -24,7 +24,7 @@
"""

__version__ = '2.0.4'
__version__ = '2.0.5'

import pkg_resources
import sys
Expand Down
3 changes: 1 addition & 2 deletions pygal/graph/funnel.py
Expand Up @@ -23,7 +23,6 @@
from pygal.adapters import none_to_zero, positive
from pygal.graph.graph import Graph
from pygal.util import alter, cut, decorate
from pygal._compat import to_str


class Funnel(Graph):
Expand Down Expand Up @@ -95,7 +94,7 @@ def _compute(self):
def _compute_x_labels(self):
self._x_labels = list(
zip(self.x_labels and
map(to_str, self.x_labels) or [
map(self._x_format, self.x_labels) or [
serie.title['title']
if isinstance(serie.title, dict)
else serie.title for serie in self.series],
Expand Down
4 changes: 2 additions & 2 deletions pygal/graph/graph.py
Expand Up @@ -173,7 +173,7 @@ def _x_axis(self):
text.text = truncate(label, truncation)
if text.text != label:
self.svg.node(guides, 'title').text = label
else:
elif self._dual:
self.svg.node(
guides, 'title',
).text = self._x_format(position)
Expand Down Expand Up @@ -748,7 +748,7 @@ def _y_major_labels(self):

def _compute_x_labels(self):
self._x_labels = self.x_labels and list(
zip(map(to_str, self.x_labels), self._x_pos))
zip(map(self._x_format, self.x_labels), self._x_pos))

def _compute_y_labels(self):
y_pos = compute_scale(
Expand Down

0 comments on commit 28037d9

Please sign in to comment.