案例
自定义悬浮框显示内容
通过 tooltip 的 formatter 设置
官网解释:
https://echarts.apache.org/zh/option.html#tooltip.formatter
formatter 可设置字符串模板 或 回调函数,回调函数功能更强大
案例
修改上图悬浮框圆点大小:
formatter:function(params){
const dot = '<span style="display:inline-block;margin-right:4px;border-radius:6px;width:6px;height:6px;background-color:'+params.color+';"></span>'
return dot + " "+params.name +": "+ params.value
}
