-
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
Add HTML legend support #1325
Comments
Thanks for posting these arguments. They are persuasive. I agree with all of your points except for one. For the advanced features, I don't think it will be any easier to take control over the legend click action. You can easily change the click behavior using d3, for example see this answer about toggling composite child charts on legend click. I also think it would be easy to add collapse/expand functionality with a similar "renderlet", and maybe you could use d3.behavior.drag for dragging too. But I agree there is a much bigger ecosystem of reusable interactive behaviors on the HTML side than the SVG side. The quickest way to get this feature into the library is to review @davejlong's PR (or start your own If you don't want to rebase the branch, you should be able to try it out just by copying the content of Once you've tried it out, please comment on #577 and I'll reopen it. Please carefully review the interface of the original legend: I think that almost all of these are layout-related and can better be done with CSS, but Would you be willing to start a new PR and add these, along with tests? |
I tried the code copying the html legend into my project with some modifications. It worked great as expected. I can make a PR from my fork. I have added legendText and maxItems and made some changes to make render method common for horizontal/vertical in that fork. Please let me know if it is fine for me to make a pull request. I have used much of the code in PR, except for changes mentioned above and specs. |
I took a quick look at your fork. This is great. Thanks for updating the tests along with adding the new functions. Please open a new PR to replace #577. I will review it more closely, and then merge it for 2.1.x. |
Thanks, I have made the PR |
Implemented in 3.0.0 |
Something like PR and I have asked question but I don't think if some take a look into closed PR so opened this bug for further discussions.
I strongly feel that HTML legend make more sense and it in-fact make life much easy atleast in the following cases Issue, Issue:
Case-1: huge list of items (see image 1 in our application - summarize data of 300K records since we couldn't show the complete list we added
"Others"
to show there more items below )Case-2: Add advance features:
Case-3: Customize (see the google map image)
The text was updated successfully, but these errors were encountered: