echarts改柱状图的tooltip中圆圈为方块型(自定义柱状图提示框)
效果图

代码
| tooltip: { |
| trigger: 'axis', |
| |
| axisPointer: { |
| type: 'shadow', |
| crossStyle: { |
| color: '#fff' |
| } |
| }, |
| |
| formatter: (data) => { |
| console.log('parma', data) |
| let str = '<div style="color:#0C1B52;font-size: 15px;font-weight: bold;margin-bottom: 5px;">' + data[0].axisValue + '</br></div>' |
| data.reverse().forEach(item => { |
| str = str + '<div style="font-size: 12px;padding: 4px 0">' + '<div style="display:inline-block;margin-right:4px;width:10px;height:10px;background-color:' + item.color + ';"></div>' + item.seriesName + ' : ' + item.data + '</br></div>' |
| }) |
| return str |
| }, |
| textStyle: { |
| fontSize: 14 |
| } |
| }, |
复制