|
|
@ -326,9 +326,10 @@ def prepare_values(raw, config, cls): |
|
|
|
from pygal.graph.datey import DateY |
|
|
|
from pygal.graph.datey import DateY |
|
|
|
from pygal.graph.histogram import Histogram |
|
|
|
from pygal.graph.histogram import Histogram |
|
|
|
from pygal.graph.worldmap import Worldmap |
|
|
|
from pygal.graph.worldmap import Worldmap |
|
|
|
|
|
|
|
from pygal.graph.frenchmap import FrenchMapDepartments |
|
|
|
if config.x_labels is None and hasattr(cls, 'x_labels'): |
|
|
|
if config.x_labels is None and hasattr(cls, 'x_labels'): |
|
|
|
config.x_labels = cls.x_labels |
|
|
|
config.x_labels = cls.x_labels |
|
|
|
if config.zero == 0 and issubclass(cls, Worldmap): |
|
|
|
if config.zero == 0 and issubclass(cls, (Worldmap, FrenchMapDepartments)): |
|
|
|
config.zero = 1 |
|
|
|
config.zero = 1 |
|
|
|
|
|
|
|
|
|
|
|
for key in ('x_labels', 'y_labels'): |
|
|
|
for key in ('x_labels', 'y_labels'): |
|
|
@ -358,7 +359,7 @@ def prepare_values(raw, config, cls): |
|
|
|
metadata = {} |
|
|
|
metadata = {} |
|
|
|
values = [] |
|
|
|
values = [] |
|
|
|
if isinstance(raw_values, dict): |
|
|
|
if isinstance(raw_values, dict): |
|
|
|
if issubclass(cls, Worldmap): |
|
|
|
if issubclass(cls, (Worldmap, FrenchMapDepartments)): |
|
|
|
raw_values = list(raw_values.items()) |
|
|
|
raw_values = list(raw_values.items()) |
|
|
|
else: |
|
|
|
else: |
|
|
|
value_list = [None] * width |
|
|
|
value_list = [None] * width |
|
|
@ -390,7 +391,8 @@ def prepare_values(raw, config, cls): |
|
|
|
value = (None, None) |
|
|
|
value = (None, None) |
|
|
|
elif not is_list_like(value): |
|
|
|
elif not is_list_like(value): |
|
|
|
value = (value, config.zero) |
|
|
|
value = (value, config.zero) |
|
|
|
if issubclass(cls, DateY) or issubclass(cls, Worldmap): |
|
|
|
if issubclass(cls, DateY) or issubclass( |
|
|
|
|
|
|
|
cls, (Worldmap, FrenchMapDepartments)): |
|
|
|
value = (adapter(value[0]), value[1]) |
|
|
|
value = (adapter(value[0]), value[1]) |
|
|
|
else: |
|
|
|
else: |
|
|
|
value = list(map(adapter, value)) |
|
|
|
value = list(map(adapter, value)) |
|
|
|