首页 > 解决方案 > 当另一个 div 位于图表上时,保持 highcharts 图例响应

问题描述

我想在 HighCharts 极坐标图边距的四个角上显示 html 按钮。我能够使用 css 在图表 div 上分层按钮。但是,这样做会导致图表图例项不响应鼠标单击。

这是其中一个按钮的代码示例:

<div className="pop-chart-button pop-chart-button-top pop-chart-button-left">
  <a role="button" onClick={this.showBrandQuadrantChart}>
    <img src={expandImageUrl} alt="expand" /> BRAND
  </a>
</div>

有什么方法可以做到这一点,不会使图例项目对鼠标单击没有响应?

标签: reactjshighchartssass

解决方案


只需在没有看到 CSS 代码的情况下进行猜测,按钮 z-index 就在图表下方。将按钮设置为更高的 z-index 可能会解决此问题。


推荐阅读