Browse Source

Add test case for issue #35

pull/39/head
Florian Mounier 12 years ago
parent
commit
a7d3a090e0
  1. 4
      pygal/graph/line.py
  2. 6
      pygal/test/test_graph.py

4
pygal/graph/line.py

@ -117,8 +117,8 @@ class Line(Graph):
if self.include_x_axis:
# Y Label
self._box.ymin = min(self._min, 0)
self._box.ymax = max(self._max, 0)
self._box.ymin = min(self._min or 0, 0)
self._box.ymax = max(self._max or 0, 0)
else:
self._box.ymin = self._min
self._box.ymax = self._max

6
pygal/test/test_graph.py

@ -179,6 +179,12 @@ def test_no_data_with_no_values(Chart):
assert q(".text-overlay text").text() == "No data"
def test_no_data_with_no_values_with_include_x_axis(Chart):
chart = Chart(include_x_axis=True)
q = chart.render_pyquery()
assert q(".text-overlay text").text() == "No data"
def test_no_data_with_empty_serie(Chart):
chart = Chart()
chart.add('Serie', [])

Loading…
Cancel
Save