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.效果


浙公网安备 33010602011771号