报错:

核心代码:

def chart_bar(request):
"""构造柱状图的数据"""
# 数据可以去数据库中获取
legend = ['黄玉兰', '1010']
series_list = ['1月', '2月', '4月', '5月', '6月', '7月']
x_axis = [
{
"name": '黄玉兰',
"type": 'bar',
"data": [5, 20, 36, 10, 10, 20]
},
{
"name": '1010',
"type": 'bar',
"data": [15, 10, 66, 40, 20, 10]
}
]
result = {
"status": True,
"data": {
'legend': legend,
'series_list': series_list,
'x_axis': x_axis,
}
}
return JsonResponse(result)
在用echarts做柱状图的时候,如果是写静态页面,是可以正常使用的。如果需要前后端传数据,就报错如上,请问有伙伴知道如何解决嘛