echarts自定义悬浮窗样式

 tooltip: {
              trigger: 'item',
              axisPointer: {
                type: "shadow",
              },
              textStyle: {
                fontSize: 30,
                color: "#fff",
              },
              // 自定义弹窗样式
              padding: 0,
              backgroundColor: "transparent",
              formatter: function(params){
          // 设置悬浮窗背景样式,下面的代码是渐变色
          // params,悬浮窗要显示的内容在params参数中查找
let str = `<div style = " padding: 5px 10px; background: -webkit-radial-gradient(circle, rgba(0,86,165,0.70),rgba(0,86,165,0.5)) !important; background: -o-radial-gradient(circle, rgba(0,86,165,0.70),rgba(0,86,165,0.5)) !important; background: -moz-radial-gradient(circle, rgba(0,86,165,0.70),rgba(0,86,165,0.5)) !important; background: radial-gradient(circle,rgba(0,86,165,0.70),rgba(0,86,165,0.5)) !important; no-repeat center center ; width:100%;height:100%; ">${params.name}<br />${params.percent}%</div>`; // 设置显示内容 return str; } },

  

posted @ 2021-11-19 09:32  我的世界蹦擦擦  Views(1363)  Comments(0Edit  收藏  举报