Browse Source

Don't put the xy value at zero if the value is simply missing. Fix #22

pull/26/merge
Florian Mounier 12 years ago
parent
commit
461d10f9ab
  1. 5
      pygal/util.py

5
pygal/util.py

@ -299,6 +299,7 @@ def prepare_values(raw, config, cls):
"""Prepare the values to start with sane values""" """Prepare the values to start with sane values"""
if not raw: if not raw:
return return
adapters = list(cls._adapters) or [lambda x:x] adapters = list(cls._adapters) or [lambda x:x]
if config.logarithmic: if config.logarithmic:
for fun in not_zero, positive: for fun in not_zero, positive:
@ -333,7 +334,9 @@ def prepare_values(raw, config, cls):
value = raw_value value = raw_value
if cls.__name__ == 'XY': if cls.__name__ == 'XY':
if not hasattr(value, '__iter__'): if value is None:
value = (None, None)
elif not hasattr(value, '__iter__'):
value = (value, config.zero) value = (value, config.zero)
value = map(adapter, value) value = map(adapter, value)
else: else:

Loading…
Cancel
Save