为什么现在我在js文件获取来自flask传来的对象数据爆红呀
就是这个{{ communityName|tojosn}},而且运行时也会前端html也会有这个错误,但我看别人可以运行
// (function(){
// var myChart=
// })();//
(function(){
//实例化
var myChart = echarts.init(document.getElementById('histogram_1'));
//数据
var communityName = {{ communityName|tojosn}};
// var data = communityName
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data : communityName,
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: 'Direct',
type: 'bar',
barWidth: '60%',
data: [40, 52, 200, 334, 390, 330, 220,49]
}
]
};
//配置项给实例对象
myChart.setOption(option)
})();//直方图