tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(255,255,255,0.8)', // 框的背景颜色
padding: [
10, // 上
17, // 右
10, // 下
10, // 左
],
borderColor: 'rgba(0, 0, 0, 0.1)', // 边框颜色
borderWidth: 1, // 边框宽
// 具体的弹框内容
formatter: function(params) {
// console.log('tooltip-params:', params);
var result = '';
params.forEach(function(item) {
result += '<span style="display:inline-block;margin-right: 5px;border-radius:3px;width:6px;height:6px;background-color:' + item.color + '"></span>';
result += '<span style="color:#000;">' + item.name + ' 开工时长</span><br>';
result += '<span style="color:#1677FE;font-weight: 600;padding-left: 10px;">' + item.data + ' H</span><br>';
});
return result;
}
},
echarts-tooltip
最新推荐文章于 2024-05-10 17:28:00 发布