【发布时间】:2017-12-24 10:04:30
【问题描述】:
一旦我的鼠标悬停在谷歌图表上的实际工具提示上,我就会得到一个闪烁的工具提示。我一直在寻找解决方案,但到目前为止还没有解决这个问题。他们在这里debate about the mouse being below the tooltip element is what is causing the flickering。提出了一种解决方法,由于我缺乏有关角度的知识,我可能无法实施。
//Change:
google.charts.load('current', {'packages':['corechart']});
//To:
google.charts.load('42', {'packages':['corechart']});
我加载图表的方式是在我的 html 组件中调用以下内容。
<google-chart [data]="pieChartData"
ng-style="svg > g > g:last-child { pointer-events: none }"></google-chart>
提出的另一个解决方案是在样式中将pointer-events 设置为none。我尝试将这些行添加到我的 css 组件中。
svg > g > g:last-child { pointer-events: none }
div.google-visualization-tooltip { pointer-events: none }
没有任何结果,我还尝试在我的 html 组件中添加 pointer-events: none 到我绘制饼图的标签上。将 'style' 和 'ng-style. However, I can imagine setting thepointer-events` 设置为 none 时,工具提示根本不会显示,这是对正确功能的改进,但仍然不需要。
编辑: 我正在使用以下模块:https://www.npmjs.com/package/ng2-google-charts
【问题讨论】:
-
github线程上提到的解决方案对我来说很好:jsfiddle.net/khrismuc/pm3p4eya您的问题是关于实现它,但您没有向我们展示minimal reproducible example。
-
@ChrisG 所以既然这是有角度的,我需要发布与图表相关的所有内容?这比您不使用角度的最小示例中的要多得多。我在
chart.component.css中有.piechart svg > g > g:last-child { pointer-events: none }并将标签<google-chart>包装在<div class="piechart">中,但没有任何改进。我的问题可能在于我对角度的了解以及事物如何相互交流。
标签: javascript css angular charts google-visualization