Hi Lucas,
This is a good point: d3@6, used in dc 4+ by default although it is still compatible with d3@5, changed the signature for callback functions. Instead of taking (datum, i, elements), callbacks now take (event, datum). The target element of the event is passed as this or can be retrieved from event.currentTarget; i and elements need to be found other ways.
Please take a look at their documentation for the change:
It looks like some of those tricks won't work, and you might have to look at the element in this.
We probably could document this better, but it's tough documenting the changes of underlying libraries.I think you would get the same results with HtmlLegend.
Sorry for any inaccuracies; I have been away from dc.js for a while.
Cheers,
Gordon
Would this solution work with HtmlLegend?