dc.js
dc.js copied to clipboard
pie charts legends not using label()
Hello!
Newcomer to dc.js, sorry for the possibly dumb question.
When doing a pie chart, the legend is using d.key, which in my case is an ID and not a label. I'm using the label() function to translate them and the pie chart itself looks fine, but the legend shows the IDs. So for consistency, why not use the label function to generate the names in the legend?
Thanks!
It's often that the labels show different information like percentage values or sth. like that. That wouldn't make so much sense with the legend. But I agree with you that the legend should be more configurable.
Is this dead?
Hi @digitalsanity, dc.js is alive and well, but not every contribution has been merged.
It looks like the associated PR #916 stalled because I wasn’t sure if the same change had to be made for other charts. I.e. should the legendLabelAccessor
go on the pie chart or the base mixin?
Without that merged, a workaround could be to override .legendables
and change labels. Messy though.