Chartjs-Object list into chart labels not working

0👍

I think something like: [{% for t in timeline %}t|date:"j b",{% endfor %}]

0👍

Solution

First encoding the data with json in the view:

json_timeline = json.dumps(timeline)

And the in the template script:

labels: {{timeline|safe}},

I get the information from the attached link: Pass a list of string from Django to Javascript

Leave a comment