In a chart created in flask application. I have to loop through a dictionary as well as a list. I have this as of now.
series:
[{
points: [
{% for key, value in Top10.items() %}
{% for color in colors%}
{ x: "{{key}}", y: {{ value }}, fill = "{{ color }}" }, //"" as it is a string
{% endfor %}
{% endfor %}
]
}],
Top 10 = {"a":10,"b":15,"c":5,"d":8,"e":4,..} and Colors = ["blue", "black", "red"...]
Current output : { x: "a", y: 10, fill = "blue" }, { x: "a", y: 10, fill = "black" }, ....
Expected output for the loop is : { x: "a", y: 10, fill = "blue" }, { x: "b", y: 15, fill = "black" },....