ucharts图表tooltip自定义内容

1. 找到源码下面的这个文件

 

 

 

 

 2. 增加红色方框中的代码

 

 

 

 

 3.组件中使用

 

 

 4.传入tooltipArr的格式

this.toolTipArr = data.map((item) => {
return [{
text: `二氧化碳浓度:${item.co2}`,
color: '#1990FF'
},
{
text: `能耗:${item.energy}`,
color: '#91CB75'
},
{
text: `甲醇浓度:${item.formaldehyde}`,
color: '#FAC858'

},
{
text: `湿度:${item.humidity}`,
color: '#EE6667'
},
{
text: `PM2.5:${item.pm}`,
color: '#73C0DE'
},
{
text: `温度:${item.temperature}`,
color: '#3DA171'

},
{
text: `${item.createTime}`,
color:'#FC332F'
}
]

})

 

5.效果

 

posted @ 2022-05-11 13:38  大海啊都是水啊水  阅读(2817)  评论(0)    收藏  举报