From b37d6a75a8ee1ee7b875335090afa8d5357fd09d Mon Sep 17 00:00:00 2001 From: AyushStarGupta <37546890+AyushCodez@users.noreply.github.com> Date: Sun, 20 Feb 2022 13:04:47 +0530 Subject: [PATCH] Fix bug Bug when no data points available in given date range --- main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.py b/main.py index 2444b39..5f6289d 100644 --- a/main.py +++ b/main.py @@ -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))