diff --git a/pyflot/graph.py b/pyflot/graph.py index d67e4d5..4282997 100644 --- a/pyflot/graph.py +++ b/pyflot/graph.py @@ -53,7 +53,7 @@ class DuplicateLabelException(Exception): label a new series with a label already in use""" -LINE_TYPES = ('bars', 'line', 'points') +LINE_TYPES = ('bars', 'lines', 'points') class Flot(object): @@ -102,7 +102,7 @@ def options_json(self): def __getattr__(self, value): """ add_bars - add_line + add_lines add_points provides shortcut methods for adding series using a particular line type @@ -116,7 +116,9 @@ def add_series_type(self, line_type, series, label=None, **kwargs): """Used as a partial by __getattr__ to auto set the line_type for the series.""" method = getattr(self, 'add_series') - return method(series, label, **{line_type: True}) + new_kwargs = {line_type: True} + new_kwargs.update(kwargs) + return method(series, label, **new_kwargs) def add_series(self, series, label=None, **kwargs): """ @@ -153,6 +155,11 @@ def add_series(self, series, label=None, **kwargs): new_series.update({line_type: kwargs[line_type]}) else: new_series.update({line_type: {'show': True}}) + + for k,v in kwargs.items(): + if not k == line_type: + new_series[line_type].update({k:v}) + self._series.append(new_series) #def add_time_series(self, series, label=None, **kwargs):