问题描述
这个问题询问了Google图表,但更一般。 图表中的图例的鼠标悬停产生了此错误: 我没有添加任何'onmouseover'事件等等,它似乎只是对 有没有其他人有这个问题?有没有办法禁用图表图例的任何鼠标悬停事件? 非常感谢您提供的任何建议。 更新: 。看起来Google图表不喜欢让两个x和y点具有完全相同的值。 您可以尝试停止适当的鼠标事件到达内置的处理程序。 这需要在图表的图例中添加一个 事实上, 以下方法适用于Firefox: This question asks about Google charts, but is more general. Mouseover of the legend in my chart gives this error: I haven't added any 'onmouseover' events, etc., it appears that it's just unhappy with the appearance of Has anyone else had this problem? Is there a way to disable any mouseover events for the chart legend? Thanks a lot for any advice you can give. Update: There is a minimal jsfiddle demonstrating this error here. It seems Google charts doesn't like having two x and y points that have the exact same values. You could try stopping appropriate mouse events from reaching the built-in handlers. This requires adding a It turns out that The following worked for me on Firefox: 这篇关于Javascript:从对象中移除所有的mouseover事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
$ b null
在系列中的外观感到不满(当你绘制两个系列具有不同的x值,谷歌图表表示将空点添加为 null
,并用 interpolateNull:true
)绘图。
mouseover
侦听器。
监听器会调用 event.stopPropagation()
(并且在 capture $ c $期间并不需要触发事件传播的阶段)。
mousemove
事件也正在被侦听,所以停止他们也是。
$(' svg> g:first-of-type')。bind('mouseover mousemove',function(e){e.stopPropagation();});
null
in the series (when you plot two series with different x-values, Google charts says to add empty points as null
and plot with interpolateNull : true
). mouseover
listener to the chart's legend.The listener will call event.stopPropagation()
(and surprisingly doesn't need to be triggered during the capture
phase of event propagation).mousemove
events are also being listened to, so stop them too. $('svg > g:first-of-type').bind('mouseover mousemove', function(e) { e.stopPropagation(); });