-
Notifications
You must be signed in to change notification settings - Fork 0
/
growth.py
31 lines (22 loc) · 885 Bytes
/
growth.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from datetime import datetime, timedelta
from database import DatabaseReader
from plotter import Plotter
class Growth(Plotter):
def get_data(self, limit: int, include: set[int] = None) -> list[tuple]:
dbr = DatabaseReader()
return dbr.get_growth_in_range(self.start_date, self.end_date, limit=limit, include=include)
def configure(self) -> None:
super().configure()
self.ax.set_ylabel("XP Growth")
self.ax.set_ylim([0, self.max_xp * 1.05])
if __name__ == '__main__':
# plot = Growth(start_date=datetime(year=2020, month=6, day=28),
# end_date=datetime(year=2021, month=3, day=22))
plot = Growth(start_date=datetime.now() - timedelta(days=7))
plot.draw()
plot.draw_events()
plot.annotate()
plot.configure()
plot.save()
plot.show()
# end_date=datetime(year=2021, month=3, day=22)