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; } },

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM