From 58ea7410943b3ef96c76ed2c7cedd12e59cc1b69 Mon Sep 17 00:00:00 2001 From: crflynn Date: Sat, 28 Apr 2018 01:16:14 -0400 Subject: [PATCH] plot fix --- pypistats/plots/data_base.json | 57 +++++++++++++++++----------------- pypistats/views/general.py | 2 +- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/pypistats/plots/data_base.json b/pypistats/plots/data_base.json index ab9e548..bbf55bb 100644 --- a/pypistats/plots/data_base.json +++ b/pypistats/plots/data_base.json @@ -1,33 +1,32 @@ -{"data": [ - { - "x": [ - "2017-05-01", - "2017-05-02", - "2017-05-03" - ], - "y": [ - "345234", - "123123", - "456344" - ], - "name": "Retention", - "type": "scatter", - "mode": "lines+markers", - "connectgaps": true, - "marker": { - "color": "rgba(61,133,198,1)", - "symbol": "circle", +{ + "data": [ + { + "x": [ + "2017-05-01", + "2017-05-02", + "2017-05-03" + ], + "y": [ + "2", + "5", + "4" + ], + "name": "Retention", + "type": "scatter", + "mode": "lines+markers", + "connectgaps": true, + "marker": { + "symbol": "circle", + "line": { + "color": "#444", + "width": 1 + } + }, "line": { - "color": "#444", - "width": 1 + "shape": "linear", + "smoothing": 1, + "width": 2 } - }, - "line": { - "color": "rgba(61,133,198,1)", - "shape": "linear", - "smoothing": 1, - "width": 2 } - } -] + ] } diff --git a/pypistats/views/general.py b/pypistats/views/general.py index 9ad8083..2288667 100644 --- a/pypistats/views/general.py +++ b/pypistats/views/general.py @@ -130,7 +130,7 @@ def package(package): plot = deepcopy(plot_base) data = [] for category, values in model["data"].items(): - base = deepcopy(data_base) + base = deepcopy(data_base["data"][0]) base["x"] = values["x"] base["y"] = values["y"] base["name"] = category.title()