From 51a9e9eb118e866110e8878df003c8ee19db9c8a Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Tue, 23 Feb 2016 15:41:07 +0100 Subject: [PATCH] Convert the allow_interruptions kwargs to a full featured serie config option. --- pygal/config.py | 3 +++ pygal/graph/line.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pygal/config.py b/pygal/config.py index 716e0ee..f77338f 100644 --- a/pygal/config.py +++ b/pygal/config.py @@ -218,6 +218,9 @@ class CommonConfig(BaseConfig): inner_radius = Key( 0, float, "Look", "Piechart inner radius (donut), must be <.9") + allow_interruptions = Key( + False, bool, "Look", "Break lines on None values") + class Config(CommonConfig): diff --git a/pygal/graph/line.py b/pygal/graph/line.py index 37fbd8c..b5cf3df 100644 --- a/pygal/graph/line.py +++ b/pygal/graph/line.py @@ -35,7 +35,6 @@ class Line(Graph): def __init__(self, *args, **kwargs): """Set _self_close as False, it's True for Radar like Line""" self._self_close = False - self.allow_interruptions = kwargs.get('allow_interruptions', False) super(Line, self).__init__(*args, **kwargs) @cached_property @@ -143,7 +142,7 @@ class Line(Graph): if serie.fill: view_values = self._fill(view_values) - if self.allow_interruptions: + if serie.allow_interruptions: # view_values are in form [(x1, y1), (x2, y2)]. We # need to split that into multiple sequences if a # None is present here