为什么笔刷阻止dc.js barChart工具提示出现? [英] Why is the brush preventing dc.js barChart toolTips to appear?

查看:68
本文介绍了为什么笔刷阻止dc.js barChart工具提示出现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么要执行这种行为. 有什么充分的理由吗?

I don't see why that behaviour was implemented. Any good reason ?

推荐答案

要具有画笔功能,必须在图形上方绘制一个捕获所有鼠标事件的透明矩形.这样可以防止任何鼠标事件触发主图形元素上的工具提示事件处理程序,这就是

In order to have a brushing function, a transparent rectangle that captures all mouse events has to be drawn over top of the graph. That prevents any mouse events from triggering the tooltip event handler on the main graph elements, and is the reason the dc.js API warns that leaving brushing behaviour "on" will disable all other interactive behaviour.

如果您希望同时拥有两种行为,请考虑使用焦点+上下文布局.该示例使用普通的d3,但是您可以使用dc.js重新创建它.只需对同一数据有两种不同的视图,一种使用画笔,另一种使用工具提示或其他交互性.

If you want both behaviours, consider using a focus + context layout. That example uses plain d3, but you could recreate it with dc.js. Just have two different views of the same data, one with the brush and one with the tooltips or other interactivity.

这篇关于为什么笔刷阻止dc.js barChart工具提示出现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆