Search code examples
d3.jstooltipbar-chartdc.js

Why is the brush preventing dc.js barChart toolTips to appear?


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


Solution

  • 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.

    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.