tooltip: { trigger: 'axis', formatter: function (params) { //回调函数 if(Array.isArray(params) && params.length > 0){ let axisValueLabel = params[0].data.time //标题 let str0 = '' params.forEach((item,index)=>{ str0 += `${item.marker}${item.seriesName}: ${item.value}` str0 += index === params.length - 1 ? '' : '<br/>' }) return axisValueLabel + '<br>' + str0 } } },
标签:index,自定义,提示,str0,item,params,echarts From: https://www.cnblogs.com/cc0518/p/16836090.html