Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import plotly.express as px
|
|
| 3 |
import streamlit as st
|
| 4 |
from transformers import pipeline
|
| 5 |
import datetime
|
|
|
|
| 6 |
|
| 7 |
# Function to add background image to the app
|
| 8 |
def add_bg_from_url(image_url):
|
|
@@ -110,7 +111,15 @@ if uploaded_file:
|
|
| 110 |
'Actual': monthly_expenses,
|
| 111 |
'Budget': [sum(budgets.values())] * len(monthly_expenses) # Same budget for simplicity
|
| 112 |
})
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
st.pyplot(fig3)
|
| 115 |
else:
|
| 116 |
st.write("No data to display for the selected date range.")
|
|
|
|
| 3 |
import streamlit as st
|
| 4 |
from transformers import pipeline
|
| 5 |
import datetime
|
| 6 |
+
import matplotlib.pyplot as plt
|
| 7 |
|
| 8 |
# Function to add background image to the app
|
| 9 |
def add_bg_from_url(image_url):
|
|
|
|
| 111 |
'Actual': monthly_expenses,
|
| 112 |
'Budget': [sum(budgets.values())] * len(monthly_expenses) # Same budget for simplicity
|
| 113 |
})
|
| 114 |
+
|
| 115 |
+
# Create a Matplotlib figure for the bar chart
|
| 116 |
+
fig3, ax = plt.subplots(figsize=(10, 6))
|
| 117 |
+
monthly_expenses_df.plot(kind='bar', x='Month', y=['Actual', 'Budget'], ax=ax)
|
| 118 |
+
ax.set_title('Monthly Spending vs Budget')
|
| 119 |
+
ax.set_ylabel('Amount ($)')
|
| 120 |
+
ax.set_xlabel('Month')
|
| 121 |
+
|
| 122 |
+
# Use st.pyplot to display the figure
|
| 123 |
st.pyplot(fig3)
|
| 124 |
else:
|
| 125 |
st.write("No data to display for the selected date range.")
|