|
|
|
@ -22,6 +22,7 @@ Commmon graphing functions
|
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
from __future__ import division |
|
|
|
|
from pygal._compat import is_list_like |
|
|
|
|
from pygal.interpolate import INTERPOLATIONS |
|
|
|
|
from pygal.graph.base import BaseGraph |
|
|
|
|
from pygal.view import View, LogView, XYLogView, ReverseView |
|
|
|
@ -710,13 +711,14 @@ class Graph(BaseGraph):
|
|
|
|
|
self._post_compute() |
|
|
|
|
self._compute_margin() |
|
|
|
|
self._decorate() |
|
|
|
|
if self.series and self._has_data(): |
|
|
|
|
if self.series and self._has_data() and self._values: |
|
|
|
|
self._plot() |
|
|
|
|
else: |
|
|
|
|
self.svg.draw_no_data() |
|
|
|
|
|
|
|
|
|
def _has_data(self): |
|
|
|
|
"""Check if there is any data""" |
|
|
|
|
return sum( |
|
|
|
|
map(len, map(lambda s: s.safe_values, self.series))) != 0 and ( |
|
|
|
|
sum(map(abs, self._values)) != 0) |
|
|
|
|
return any([ |
|
|
|
|
len([v for v in (s[1] if is_list_like(s) else [s]) if v is not None]) |
|
|
|
|
for s in self.raw_series |
|
|
|
|
]) |
|
|
|
|