tooltip部分代码如下:
formatter: function(params) {
var html = params[0].name + "\n";
for (var i = 0; i < params.length; i++) {
if (params[i].seriesName == "合格率" || params[i].seriesName == "达成率") {
let val = params[i].value * 100
let num = `${parseFloat(val.toFixed(2))}%`
html += params[i].marker + params[i].seriesName + ":" + num;
} else {
html += params[i].marker + params[i].seriesName + ":" + params[i].value + "\n";
}
}
return html;
}