InNoobWeTrust commited on
Commit
fed4ab4
·
1 Parent(s): b25d8d7

Fix scale for trading volume and individual net flow

Browse files
Files changed (1) hide show
  1. streamlit_app.py +8 -10
streamlit_app.py CHANGED
@@ -142,10 +142,12 @@ def gen_data(asset):
142
 
143
  cum_flow_individual = etf_flow_individual.drop(columns="Date").cumsum()
144
  cum_flow_individual["Date"] = etf_flow_individual.Date
145
- cum_flow_total = pd.DataFrame({
146
- "Date": etf_flow_total.Date,
147
- "Total": etf_flow_total.Total.cumsum(),
148
- })
 
 
149
 
150
  return SimpleNamespace(
151
  etf_volumes=etf_volumes,
@@ -193,9 +195,7 @@ def gen_charts(asset, chart_size={"width": 560, "height": 300}):
193
  )
194
  # Combine trading volume and average trading volume
195
  trading_vol_fig += trading_vol_avg_fig
196
- trading_vol_fig = trading_vol_fig.resolve_scale(
197
- y="independent",
198
- ).properties(
199
  title=f"{asset} ETF trading volume",
200
  **chart_size,
201
  )
@@ -224,9 +224,7 @@ def gen_charts(asset, chart_size={"width": 560, "height": 300}):
224
  )
225
  )
226
  net_flow_individual_fig += net_flow_total_line_fig
227
- net_flow_individual_fig = net_flow_individual_fig.resolve_scale(
228
- y="independent",
229
- ).properties(
230
  title=f"{asset} ETF net flow of individual funds",
231
  **chart_size,
232
  )
 
142
 
143
  cum_flow_individual = etf_flow_individual.drop(columns="Date").cumsum()
144
  cum_flow_individual["Date"] = etf_flow_individual.Date
145
+ cum_flow_total = pd.DataFrame(
146
+ {
147
+ "Date": etf_flow_total.Date,
148
+ "Total": etf_flow_total.Total.cumsum(),
149
+ }
150
+ )
151
 
152
  return SimpleNamespace(
153
  etf_volumes=etf_volumes,
 
195
  )
196
  # Combine trading volume and average trading volume
197
  trading_vol_fig += trading_vol_avg_fig
198
+ trading_vol_fig = trading_vol_fig.properties(
 
 
199
  title=f"{asset} ETF trading volume",
200
  **chart_size,
201
  )
 
224
  )
225
  )
226
  net_flow_individual_fig += net_flow_total_line_fig
227
+ net_flow_individual_fig = net_flow_individual_fig.properties(
 
 
228
  title=f"{asset} ETF net flow of individual funds",
229
  **chart_size,
230
  )