From 08ca4f10ba5104edf83d26bfa0fa4fbfdeeadeb4 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Sun, 6 May 2018 23:09:38 -0700 Subject: [PATCH] added support for dynamic names --- scripts/plot_dataframe.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/plot_dataframe.py b/scripts/plot_dataframe.py index 794536365..f6c1f2649 100755 --- a/scripts/plot_dataframe.py +++ b/scripts/plot_dataframe.py @@ -109,8 +109,10 @@ def plot_rsi_dataframe(data, fig, args, plotnumber): :param args: :return: """ - rsi = go.Scattergl(x=data['date'], y=data[args.plotrsi], name='RSI') - fig.append_trace(rsi, plotnumber, 1) + if args.plotrsi: + for x in args.plotrsi: + rsi = go.Scattergl(x=data['date'], y=data[x], name=x) + fig.append_trace(rsi, plotnumber, 1) def plot_cci_dataframe(data, fig, args, plotnumber): @@ -122,7 +124,7 @@ def plot_cci_dataframe(data, fig, args, plotnumber): :param args: :return: """ - chart = go.Scattergl(x=data['date'], y=data[args.plotcci], name='CCI') + chart = go.Scattergl(x=data['date'], y=data[args.plotcci], name=args.plotcci) fig.append_trace(chart, plotnumber, 1)