vendredi 18 décembre 2020

How to create a simple graph from dictionary in my Django project?

I created a simple dictionary in my Django view and I want to make a simple graph from it and show it in my template. The dictionary ("sum_by_date") is of working hours per date e.g. {'2020-10-09':1.5,'2020-10-10':2}. I want a graph with bars, the dates on x - axis and the hours on y-axis and a line between the dots. What is the simplest way to do so? I want something equivalent to : pyplot.bar(*zip(*sum_by_date.items())) of matplotlib.pyplot. Thank you




Aucun commentaire:

Enregistrer un commentaire