tooltip:{
textStyle:{
width:'120%' //实现宽度撑开
},
trigger:'axis',
formatter:function(params){
// 打印出params根据实际内容组装数据返回
let name = params.axisValueLable
let list = []
params.forEach((d,i)=>{
let br = (i%2===0)?'<br/>':'<span style="margin-left:-20px;display:inline-block"></span>'
let option = br + "<span style='padding-right:20px'>"+d.marke + d.seriesName + ":"+ "<span style='display:inline-block,width:calc(50% - 25px)'>"+ d.value+ "</span>"
list.push(option )
})
let paramsList = name + list.join("")
return paramsList
}
}
echarst图表tooltip展示两行实现要点
最新推荐文章于 2024-06-27 14:57:58 发布