tooltip:{
formatter:function(params){
let str = '';
params.forEach((item,idx) =>{
timeData.forEach((timeItem, timeIdx) =>{
if(item.name == timeIdx +1){
if(str.indexOf(timeItem) === -1){
str += timeItem +'<br/>'
}
}
})
str += `${item.marker}${item.seriesName}:${item.data}`
str += idx === params.length -1? '': '<br/>'
})
return str
}
}
参考文章:https://blog.csdn.net/acknowledged/article/details/101220237