效果
代码
tooltip: {
show: true,
trigger: 'axis',
formatter: function (params) {
let axisValueLabel = params[0].axisValueLabel
let sumVal = 0;
let src = axisValueLabel + '<br>';
for (let x in params) {
sumVal += Number(params[x].value)
src += params[x].marker + params[x].seriesName + ": " + params[x].value + '<br>';
}
return src
},
}