echarts canvas 层级太高 导致tooltip被遮盖

时间:2019-08-27 15:34:28   收藏:0   阅读:1810

问题截图:

技术分享图片

 

解决方法:

给echarts里面的canvas设置层级, z-index: -1

import ReactEcharts from ‘echarts-for-react‘
import styled from ‘styled-components‘ // 这里本人习惯使用styled-components处理样式, 普通的css方式也可以

// 降低canvas层级, 防止tooltip被覆盖
const ReactEchart = styled(ReactEcharts)`
  flex: 1;
  canvas {
    z-index: -1;
  }
`

 

原文:https://www.cnblogs.com/aloehui/p/11418330.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!