在烧瓶应用程序中创建的图表中。我必须遍历字典和列表。我现在有这个。
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 %}
]
}],
前 10 名 = {"a":10,"b":15,"c":5,"d":8,"e":4,..} 和颜色 = ["blue", "black", "红色的”...]
当前输出:{ x: "a", y: 10, fill = "blue" }, { x: "a", y: 10, fill = "black" }, ....
循环的预期输出是:{ x: "a", y: 10, fill = "blue" }, { x: "b", y: 15, fill = "black" },....