From 81ae787aa5e0c2b561a50a062910d65291b31d9f Mon Sep 17 00:00:00 2001 From: moshferatu Date: Mon, 1 Jan 2024 06:00:29 -0800 Subject: [PATCH] Add example of plotting a chart with multiple lines --- multi_line_chart_example.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 multi_line_chart_example.py diff --git a/multi_line_chart_example.py b/multi_line_chart_example.py new file mode 100644 index 0000000..67ceae6 --- /dev/null +++ b/multi_line_chart_example.py @@ -0,0 +1,15 @@ +from database.ohlc import ohlc +from datetime import datetime, timedelta + +from line_chart import LineChart +from plot import plot + +end_date = datetime.today().date() +start_date = (end_date - timedelta(days = 90)) +data = ohlc('SPX.XO', '1d', start_date = start_date, end_date = end_date) + +line_chart = LineChart( + x = data['Timestamp'], + values = [data['High'], data['Low']] +) +plot(line_chart) \ No newline at end of file