echarts没数据的时候,页面显示暂无数据
给个if判断
let option={}
if(data.length==0){
//没有数据或者数据不合法,显示暂无数据
option = {
title: {
text: '暂无数据',
x: 'center',
y: 'center',
textStyle: {
fontFamily: 'Manteka',
fontSize: '12',
fontWeight: 'normal',
color: '#333'
}
}
}
}else{
option={
//有数据的
}
}