echarts tooltip显示设置
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
textStyle: {
fontSize: '42',
},
formatter: function (params) {
// console.log(params)
// var result = ''
// params.forEach(function (item) {
// result +=
// item.marker +
// ' ' +
// item.seriesName +
// ' : ' +
// item.value +
// '</br>'
// result += item.seriesName + ' : ' + item.value + '</br>'
// })
return (
params[0].name +
'</br>' +
'<span style="display:inline-block;margin-right:15px;width:30px;height:30px;background-color:#3BC388"></span>' +
params[0].seriesName +
' : ' +
params[0].value +
'</br>' +
'<span style="display:inline-block;margin-right:15px;border-radius:50%;width:30px;height:30px;background-color:#CCC749"></span>' +
params[1].seriesName +
' : ' +
params[1].value
)
},
},