Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added ability to render custom legend text per item #982

Closed
wants to merge 1 commit into from

Conversation

calvino
Copy link
Contributor

@calvino calvino commented Aug 11, 2015

I needed the ability to create legends with more data than just the group name so I edited the legends widget to support that functionality. You can now dynamically generate legend text much like you would for labels or titles. You pass in a legendText function that returns the text you want to render, e.g. chart.legend(dc.legend().legendText(function(d) { return d.name + ': ' + d.data })) to create labels with counts on them if you have grouped data reduced by count.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Sep 14, 2015
@gordonwoodhull
Copy link
Contributor

Thanks @calvino!

gordonwoodhull added a commit that referenced this pull request Oct 31, 2015
@gordonwoodhull
Copy link
Contributor

Merged in 2.0.0 beta 20

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants