Skip to content
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 ability to set max legend item count #1114

Closed
wants to merge 2 commits into from
Closed

Conversation

renoth
Copy link
Contributor

@renoth renoth commented Mar 8, 2016

I needed this for a project so i implemented it and wanted to share with you guys.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Nov 24, 2016
@gordonwoodhull
Copy link
Contributor

Thanks @renoth and sorry for the slow response. This is a good idea and I only wonder if we need to add an ellipsis or something to indicate that items were removed.

I take it you use this for a chart where the items are ordered from greatest to least, and you don't want to use .cap(), or it's not available for the chart you're using?

@gordonwoodhull
Copy link
Contributor

Thanks @renoth! This is going into dc.js 2.0.

I tried adding an ellipsis item and it looked dumb, so I'm not doing that. (Also I figured it would probably have to be a link to show the rest, and that's a bigger effort.)

Added a couple of tests, checked for invalid numbers as you suggested, and also allowed zero (because why not).

gordonwoodhull added a commit that referenced this pull request Jan 3, 2017
including invalid argument - we don't usually test this but it's easy enough
gordonwoodhull added a commit that referenced this pull request Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants