MarcosRodrigo commited on
Commit
5497a55
·
verified ·
1 Parent(s): ee8e060

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -244,7 +244,8 @@ elif menu == "Graph":
244
  if st.session_state.history:
245
  history_data = []
246
  for record in st.session_state.history:
247
- date = record['Date']
 
248
  for index, row in record['Summary'].iterrows():
249
  for drink in row['Drinks'].split(', '):
250
  history_data.append({'Date': date, 'Item': drink, 'Type': 'Drink'})
@@ -271,4 +272,4 @@ elif menu == "Graph":
271
  # Display the plot
272
  st.pyplot(plt.gcf())
273
  else:
274
- st.write("No historical data available to plot.")
 
244
  if st.session_state.history:
245
  history_data = []
246
  for record in st.session_state.history:
247
+ # Extract only the date part (YYYY-MM-DD) for display
248
+ date = record['Date'].split("_")[0] # Use only the YYYY-MM-DD portion of the date
249
  for index, row in record['Summary'].iterrows():
250
  for drink in row['Drinks'].split(', '):
251
  history_data.append({'Date': date, 'Item': drink, 'Type': 'Drink'})
 
272
  # Display the plot
273
  st.pyplot(plt.gcf())
274
  else:
275
+ st.write("No historical data available to plot.")