let report7Arr = [
{
name:'2月',
value:6.70,
},
]
function filterSeries(arr,array,name1,name2){
array.map((item)=>{
if(arr[1].value == item.value && arr[1].name == item.name){
arr[0].seriesName = name1
arr[1].seriesName = name2
}
})
return arr
}
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function(params, v) {
var str = "";
for (var i = 0; i < params.length; i++) {
var y = 2020
i == 0 ? y = 2020 : y = 2021;
filterSeries(params,report7Arr,'名字1','名字2')
if (params[i].seriesName !== "") {
str +=
params[i].seriesName +
params[i].name +
":" +
params[i].value +
'%' +
"<br/>";
}
}
return str;
},
},
|