-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legend selection highlighting #600
Comments
This sounds like useful functionality. A PR would be welcome! |
@barclayadam Thanks for the above solution. This works great for me in my project for html legends. |
Could this be implemented? I keep running into problems where I am not sure which legend items are selected and which aren't. I'd be happy to implement it for the html legend, too. |
htmlLegend has the highlightSelected implemented in it. https://github.com/dc-js/dc.js/blob/develop/src/html-legend.js#L102-L108 The example page https://dc-js.github.io/dc.js/examples/html-legend.html has this set up also. |
Very cool, I hadn't noticed that. Looks like it should be easy to port to the SVG legend. |
I checked the documentation but there is no method for highligting selected legends in SVG type. Is it implemented? |
Hi @Tahirhan, clearly the functionality has not been copied over yet. If you want to give it a shot, it’s just a matter of copying all the sections having to do with I can get it into the next release if you make a PR! |
Ok, i will try :) |
Thanks @Tahirhan, merged for release 3.1.9 |
Hi,
I want the ability to highlight legend items that have an active filter. To do this the legend itself needs a class to indicate there are active filters, and then each legend item gets a class to indicate if it is active.
I modified
dc.js
legends with a couple of lines to support the scenarios I currently have, but I do not know if it could cover everything, or exactly the best way to integrate with current infrastructure:The top of
_legend.render
method becomes:The bit I'm least sure about is adding the
dc-legend-selected
class, finding out whether that legend item is a currently filtered item.For reference additional CSS I'm using is:
Thanks,
Adam
The text was updated successfully, but these errors were encountered: