Rotate date labels

This commit is contained in:
Alban Bronisz 2021-02-13 22:00:13 +01:00
parent e460e8f49d
commit cab9498f2b
1 changed files with 4 additions and 2 deletions

View File

@ -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