此时的样式与官方tooltip样式相同,可根据回调函数中的数据进行自定义的数值修改
tooltip: {
// formatter: '{a}<br />{b}: {c}'
formatter: (params) => {
const content = `
<div style="height: 25px; line-height: 25px;">
<span style="display: inline-block; margin-right: 10px; border-radius: 50%; width: 10px; height: 10px;background-color: ${params.color};"></span>
</div>
`;
const html = `
<div>${params.seriesName}</div>
<div style="display: flex;align-items: center;">
${content}${params.name} <span style="padding-left: 25px;font-weight: bolder;">${params.data.total}</span>
</div>
`;
return html
},
},