engralimalik commited on
Commit
92043a4
·
verified ·
1 Parent(s): 9189033

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -67,11 +67,11 @@ if uploaded_file:
67
  fig2 = px.line(monthly_expenses, x=monthly_expenses.index, y=monthly_expenses.values, title="Monthly Expenses", labels={"x": "Month", "y": "Amount ($)"})
68
  st.plotly_chart(fig2)
69
 
70
- # 3. Monthly Spending vs Budget (Bar Chart)
71
  monthly_expenses_df = pd.DataFrame({
72
  'Actual': monthly_expenses,
73
  'Budget': [sum(budgets.values())] * len(monthly_expenses) # Same budget for simplicity
74
  })
75
 
76
- fig3 = monthly_expenses_df.plot(kind='bar', figsize=(10, 6))
77
- st.pyplot(fig3)
 
67
  fig2 = px.line(monthly_expenses, x=monthly_expenses.index, y=monthly_expenses.values, title="Monthly Expenses", labels={"x": "Month", "y": "Amount ($)"})
68
  st.plotly_chart(fig2)
69
 
70
+ # 3. Monthly Spending vs Budget (Bar Chart with Plotly)
71
  monthly_expenses_df = pd.DataFrame({
72
  'Actual': monthly_expenses,
73
  'Budget': [sum(budgets.values())] * len(monthly_expenses) # Same budget for simplicity
74
  })
75
 
76
+ fig3 = px.bar(monthly_expenses_df, x=monthly_expenses_df.index, y=["Actual", "Budget"], title="Monthly Spending vs Budget", labels={"x": "Month", "y": "Amount ($)"})
77
+ st.plotly_chart(fig3)