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