Skip to content

Commit aedb892

Browse files
committed
Add Assets vs Liabilities chart in Balance Sheet tab
1 parent 134adfc commit aedb892

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

requirements.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
streamlit
1+
streamlit~=1.37.1
22
pytest
33
streamlit-extras
4-
pandas
5-
yfinance
6-
plotly
4+
pandas~=2.2.2
5+
yfinance~=0.2.43
6+
plotly~=5.23.0
77
streamlit-pills
8+
9+
matplotlib~=3.9.2
10+
numpy~=2.1.0

src/ui/layout.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pandas as pd
12
import plotly.graph_objects as go
23
import streamlit as st
34
from streamlit_pills import pills
@@ -294,7 +295,39 @@ def render_balance_sheet(financial_data, financial_calculations):
294295
delta=f"{current_ratio_diff:.3} ({current_ratio_change:.2f}%)",
295296
)
296297

298+
st.divider()
299+
297300
# Render Charts
301+
with st.container():
302+
assets_liabilities_chart, total_debt_chart = st.columns(2)
303+
304+
with assets_liabilities_chart:
305+
fig = go.Figure(
306+
data=[
307+
go.Bar(
308+
x=pd.DatetimeIndex(balance_sheet.index).date,
309+
y=balance_sheet["Total Assets"].values,
310+
name="Total Assets",
311+
marker_color="green",
312+
),
313+
go.Bar(
314+
x=pd.DatetimeIndex(balance_sheet.index).date,
315+
y=balance_sheet[
316+
"Total Liabilities Net Minority Interest"
317+
].values,
318+
name="Total Liabilities",
319+
marker_color="red",
320+
),
321+
]
322+
)
323+
fig.update_layout(
324+
xaxis=dict(type="category"),
325+
title="Assets vs Liabilities",
326+
)
327+
st.plotly_chart(fig, use_container_width=True)
328+
329+
with total_debt_chart:
330+
st.markdown("#### Total Debt Chart")
298331

299332

300333
def render_income_stmt(financial_data, *kwargs):

0 commit comments

Comments
 (0)