Browse Source

Compat

pull/290/head
Florian Mounier 9 years ago
parent
commit
71025671aa
  1. 2
      pygal/graph/dual.py
  2. 2
      pygal/graph/graph.py

2
pygal/graph/dual.py

@ -56,7 +56,7 @@ class Dual(Graph):
# In case of dual, x labels must adapters and so majors too # In case of dual, x labels must adapters and so majors too
self.x_labels_major = self.x_labels_major and list( self.x_labels_major = self.x_labels_major and list(
map(self._x_adapt, self.x_labels_major)) map(self._x_adapt, self.x_labels_major))
super()._compute_x_labels_major() super(Dual, self)._compute_x_labels_major()
def _get_x_label(self, i): def _get_x_label(self, i):
"""Convenience function to get the x_label of a value index""" """Convenience function to get the x_label of a value index"""

2
pygal/graph/graph.py

@ -777,7 +777,7 @@ class Graph(PublicApi):
else: else:
self._y_labels_major = [self._y_labels[ self._y_labels_major = [self._y_labels[
int(i * (label_count - 1) / (major_count - 1))][1] int(i * (label_count - 1) / (major_count - 1))][1]
for i in range(major_count)] for i in range(major_count)]
elif self.y_labels_major: elif self.y_labels_major:
self._y_labels_major = list(map(self._adapt, self.y_labels_major)) self._y_labels_major = list(map(self._adapt, self.y_labels_major))

Loading…
Cancel
Save