From cab9498f2b7518a0af94bf7bac711a3d78f72e3a Mon Sep 17 00:00:00 2001 From: Alban Bronisz Date: Sat, 13 Feb 2021 22:00:13 +0100 Subject: [PATCH] Rotate date labels --- display/render.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/display/render.py b/display/render.py index e391530..3008053 100644 --- a/display/render.py +++ b/display/render.py @@ -53,8 +53,10 @@ def load_data(stats_fn: str): def render(data: dict, web_render:bool=False): - bar_chart = pygal.StackedBar(height=400) - bar_chart.x_labels = data["date"] + bar_chart = pygal.StackedBar(height=400, legend_box_size=5, x_label_rotation=25) + labels = [d.strftime("%B %d %H:%M") for d in data["date"]] + print(labels) + bar_chart.x_labels = labels for k in data: if k == "date": continue