Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
Bug when no data points available in given date range
  • Loading branch information
AyushCodez committed Feb 20, 2022
1 parent 1d0502f commit b37d6a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def grad_date():
date2 = datetime.strptime(
cal1_tab2.get_date() + f' {a1}:{b1}:59', '%Y-%m-%d %H:%M:%S')
data = database_util.get_data_from_date(date1, date2)
if len(data) == 0:
data = [[cal_tab2.get_date() + f' {a}:{b}',0,1,0,1,0]]

# create 3 subplots for cpu, memory, disk
fig, axs = plt.subplots(3, dpi=100, figsize=(6, 5))
Expand Down

0 comments on commit b37d6a7

Please sign in to comment.