echarts图表折线图触发弹窗x轴对应项不显示背景色

最近配置折线图图表,鼠标经过折线的任意一段,会显示弹窗,同时会有蓝色区域的背景色。想要取消蓝色背景
在这里插入图片描述

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全部删除
修改之后的效果如图:
背景颜色没有了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值