shamimjony1000 commited on
Commit
e3a89c5
·
verified ·
1 Parent(s): 9afaf17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -12
app.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import streamlit as st
2
  from task_operations import TaskManager
3
  from task_visualization import TaskVisualizer
@@ -36,27 +38,39 @@ def main():
36
 
37
  if st.button("Daily Report"):
38
  report = task_manager.generate_report('daily')
39
- st.write("Daily Report:")
40
- st.dataframe(report)
41
- visualizer.plot_category_performance('daily', task_manager)
 
 
 
42
 
43
  if st.button("Weekly Report"):
44
  report = task_manager.generate_report('weekly')
45
- st.write("Weekly Report:")
46
- st.dataframe(report)
47
- visualizer.plot_category_performance('weekly', task_manager)
 
 
 
48
 
49
  if st.button("Monthly Report"):
50
  report = task_manager.generate_report('monthly')
51
- st.write("Monthly Report:")
52
- st.dataframe(report)
53
- visualizer.plot_category_performance('monthly', task_manager)
 
 
 
54
 
55
  if st.button("Yearly Report"):
56
  report = task_manager.generate_report('yearly')
57
- st.write("Yearly Report:")
58
- st.dataframe(report)
59
- visualizer.plot_category_performance('yearly', task_manager)
 
 
 
60
 
61
  visualizer.plot_performance()
62
  visualizer.plot_overall_category_performance()
 
1
+ # app.py
2
+
3
  import streamlit as st
4
  from task_operations import TaskManager
5
  from task_visualization import TaskVisualizer
 
38
 
39
  if st.button("Daily Report"):
40
  report = task_manager.generate_report('daily')
41
+ if not report.empty:
42
+ st.write("Daily Report:")
43
+ st.dataframe(report)
44
+ visualizer.plot_category_performance('daily', task_manager)
45
+ else:
46
+ st.warning("No tasks for today.")
47
 
48
  if st.button("Weekly Report"):
49
  report = task_manager.generate_report('weekly')
50
+ if not report.empty:
51
+ st.write("Weekly Report:")
52
+ st.dataframe(report)
53
+ visualizer.plot_category_performance('weekly', task_manager)
54
+ else:
55
+ st.warning("No tasks for this week.")
56
 
57
  if st.button("Monthly Report"):
58
  report = task_manager.generate_report('monthly')
59
+ if not report.empty:
60
+ st.write("Monthly Report:")
61
+ st.dataframe(report)
62
+ visualizer.plot_category_performance('monthly', task_manager)
63
+ else:
64
+ st.warning("No tasks for this month.")
65
 
66
  if st.button("Yearly Report"):
67
  report = task_manager.generate_report('yearly')
68
+ if not report.empty:
69
+ st.write("Yearly Report:")
70
+ st.dataframe(report)
71
+ visualizer.plot_category_performance('yearly', task_manager)
72
+ else:
73
+ st.warning("No tasks for this year.")
74
 
75
  visualizer.plot_performance()
76
  visualizer.plot_overall_category_performance()