Improved graph

parent d8adceea
......@@ -13,8 +13,8 @@ HEIGHT = 1000
WIDTH = 1000
HEADER_SIZE = 70
COLOR_OPEN = Color("green")
COLOR_CLOSE = Color("red")
COLOR_OPEN = Color("#387002")
COLOR_CLOSE = Color("#d32f2f")
GRADIENT_NUMBER_COLORS = 11
......@@ -93,16 +93,30 @@ class PresenceGraph(Drawing):
# Header line
g.add(Line((0, HEADER_SIZE), (WIDTH, HEADER_SIZE)))
g = self.add(Group(id="hours_grid",
stroke="black",
stroke_width="2"
))
for i in [j*930/13 for j in range(1,13)]:
g.add(Line((0, HEADER_SIZE + i),
(WIDTH/2 - 50, HEADER_SIZE + i)))
g.add(Line((WIDTH/2 + 50, HEADER_SIZE + i),
(WIDTH, HEADER_SIZE + i)))
def _add_hours(self) -> None:
g = self.add(Group(id="hours",
text_anchor="middle",
font_size="30",
font_size="20",
font_family="Sans",
font_weight="bold"
))
g.add(Text(START_TIME.strftime("%H:%M"), x=[WIDTH / 2], y=[HEADER_SIZE], dy=[40]))
g.add(Text(END_TIME.strftime("%H:%M"), x=[WIDTH / 2], y=[HEIGHT], dy=[-15]))
#g.add(Text(START_TIME.strftime("%H:%M"), x=[WIDTH / 2], y=[HEADER_SIZE], dy=[30]))
#g.add(Text(END_TIME.strftime("%H:%M"), x=[WIDTH / 2], y=[HEIGHT], dy=[-10]))
for i, y in enumerate([j * 930 / 13 for j in range(1, 13)]):
g.add(Text("{}:00".format(i+9), x=[WIDTH / 2], y=[HEADER_SIZE + y], dy=[7]))
def _add_header(self) -> None:
g = self.add(Group(id="header"))
......@@ -117,5 +131,5 @@ class PresenceGraph(Drawing):
font_weight="bold"
))
for i, day in enumerate(["Mon.", "Tue.", "Wed.", "Thu.", "Thu."]):
for i, day in enumerate(["Mon.", "Tue.", "Wed.", "Thu.", "Fri."]):
g.add(Text(day, x=[(i * 2 + 1) * WIDTH / 10], y=[HEADER_SIZE / 2], dy=[13]))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment