关键代码:
tooltip: {
trigger: "axis",
// 鼠标经过柱体的背景
axisPointer: {
type: "line",
z:0, // 层级(权重)
lineStyle:{
type:'solid', // 将虚线改为实线
width:40, // 设置背景的宽度
color:'rgb(179, 179, 179,0.3)'
}
},
},
效果展示: