echarts悬浮窗做透明效果

tooltip: {
    trigger: 'axis',
    borderWidth: 0,
    padding: [0],
    backgroundColor: 'rgba(50,50,50,0)',
    alwaysShowContent: true, //是否永远显示提示框内容
    axisPointer: {
      type: 'shadow'
    },
    formatter: function (params) {
      return `<div style="width: 180px;padding: 10px; font-size: 12px;border-radius: 6px;
      border-image: linear-gradient(335deg, #FFFFFF 3%, rgba(255, 255, 255, 0) 79%) 0.5;
          backdrop-filter: blur(1px);
          background:  linear-gradient(319deg, rgba(253, 254, 255, 0.6) -7%, rgba(244, 247, 252, 0.6) 86%)"
      ">
    <div style="display: flex;justify-content: space-between;margin-bottom: 5px;padding: 0 5px;">
        <span>${params[0].data[0]}</span>
        <span>${
          params[0].data[1] + params[1].data[1] + params[2].data[1] + params[3].data[1]
        }/辆</span>
    </div>
    <div style="display: flex;justify-content: space-between;height: 32px;margin-bottom: 5px;line-height: 32px; background-color: #fff;padding: 0 10px;border-radius:4px;">
        <div>
            <span style="display: inline-block;width: 10px;height: 10px;margin-right: 10px;background-color: #0165FE;border-radius: 2px;"></span>
            <span>蓝色车牌</span>
        </div>
        <div style="font-size: 13px;">${params[3].data[1]}/辆</div>
    </div>
     <div style="display: flex;justify-content: space-between;height: 32px;margin-bottom: 5px;line-height: 32px; background-color: #fff;padding: 0 10px;border-radius:4px;">
        <div>
            <span style="display: inline-block;width: 10px;height: 10px;margin-right: 10px;background-color: #FFB200;border-radius: 2px;"></span>
            <span>黄色车牌</span>
        </div>
        <div style="font-size: 13px;">${params[2].data[1]}/辆</div>
    </div>
    <div style="display: flex;justify-content: space-between;height: 32px;margin-bottom: 5px;line-height: 32px; background-color: #fff;padding: 0 10px;border-radius:4px;">
        <div>
            <span style="display: inline-block;width: 10px;height: 10px;margin-right: 10px;background-color: #6DE55E;border-radius: 2px;"></span>
            <span>渐变绿车牌</span>
        </div>
        <div style="font-size: 13px;">${params[1].data[1]}/辆</div>
    </div>
    <div style="display: flex;justify-content: space-between;height: 32px;margin-bottom: 5px;line-height: 32px; background-color: #fff;padding: 0 10px;border-radius:4px;">
        <div>
            <span style="display: inline-block;width: 10px;height: 10px;margin-right: 10px;background-color: #D5DEEE;border-radius: 2px;"></span>
            <span>白色车牌</span>
        </div>
        <div style="font-size: 13px;">${params[0].data[1]}/辆</div>
    </div>

</div>`
    }
  },

backgroundColor: 'rgba(50,50,50,0)',

border-image: linear-gradient(335deg, #FFFFFF 3%, rgba(255, 255, 255, 0) 79%) 0.5;

          backdrop-filter: blur(1px);

          background:  linear-gradient(319deg, rgba(253, 254, 255, 0.6) -7%, rgba(244, 247, 252, 0.6) 86%)"

重点是这几行代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值