InNoobWeTrust
commited on
Commit
•
a99e2d3
1
Parent(s):
fed4ab4
Fix trading volume
Browse files- streamlit_app.py +3 -3
streamlit_app.py
CHANGED
@@ -181,7 +181,7 @@ def gen_charts(asset, chart_size={"width": 560, "height": 300}):
|
|
181 |
color="Funds:N",
|
182 |
)
|
183 |
)
|
184 |
-
|
185 |
alt.Chart(etf_volumes)
|
186 |
.transform_fold(
|
187 |
etf_volumes.drop(columns="Date").columns.to_list(), as_=["Funds", "Volume"]
|
@@ -189,12 +189,12 @@ def gen_charts(asset, chart_size={"width": 560, "height": 300}):
|
|
189 |
.mark_line()
|
190 |
.encode(
|
191 |
x=alt.X("Date:T", axis=alt.Axis(tickCount="day")),
|
192 |
-
y=alt.Y("
|
193 |
color=alt.value("crimson"),
|
194 |
)
|
195 |
)
|
196 |
# Combine trading volume and average trading volume
|
197 |
-
trading_vol_fig +=
|
198 |
trading_vol_fig = trading_vol_fig.properties(
|
199 |
title=f"{asset} ETF trading volume",
|
200 |
**chart_size,
|
|
|
181 |
color="Funds:N",
|
182 |
)
|
183 |
)
|
184 |
+
trading_vol_total_fig = (
|
185 |
alt.Chart(etf_volumes)
|
186 |
.transform_fold(
|
187 |
etf_volumes.drop(columns="Date").columns.to_list(), as_=["Funds", "Volume"]
|
|
|
189 |
.mark_line()
|
190 |
.encode(
|
191 |
x=alt.X("Date:T", axis=alt.Axis(tickCount="day")),
|
192 |
+
y=alt.Y("sum(Volume):Q", title="Total Volume"),
|
193 |
color=alt.value("crimson"),
|
194 |
)
|
195 |
)
|
196 |
# Combine trading volume and average trading volume
|
197 |
+
trading_vol_fig += trading_vol_total_fig
|
198 |
trading_vol_fig = trading_vol_fig.properties(
|
199 |
title=f"{asset} ETF trading volume",
|
200 |
**chart_size,
|