最近配置折线图图表,鼠标经过折线的任意一段,会显示弹窗,同时会有蓝色区域的背景色。想要取消蓝色背景
tooltip: {
trigger: ‘axis’,
show:true,
backgroundColor: ‘none’,
padding: 5,
axisPointer: {
type:‘none’
},
axisPointer:{
type:'line',
lineStyle:{
color:'red ',
}
},
xAxis: [{
type: ‘category’,
data: xData,
axisLabel: {
show: true,
fontSize: 9,
textStyle: {
color: "#C9C8CD" //X轴文字颜色
},
formatter: function(value) {
var str = "";
str += value.substring(0, 4) + "\n";
str += value.substring(5, 10);
return str;
}
},
axisLine: {
show: false //不显示x轴
},
axisTick: {
show: false //不显示刻度
},
boundaryGap: false,
splitLine: {
show: false,
width: 0.08,
lineStyle: {
type: "solid",
color: "#03202E"
}
},
axisPointer: { //轴指示器
type: 'shadow',
z: 1,
shadowStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(18,155,249,0)' // 0% 处的颜色
}, {
offset: 1,
color: 'rgba(18,155,249,1)' // 100% 处的颜色
}],
global: false // 缺省为 false
},
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowBlur: 5
}
},
}],
把tooltip里的linestyle颜色改为
lineStyle:{
color:‘transparent’,
}
把x轴中的 axisPointer全部删除
修改之后的效果如图: