dc.js icon indicating copy to clipboard operation
dc.js copied to clipboard

pie charts legends not using label()

Open sylvinus opened this issue 10 years ago • 3 comments

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!

sylvinus avatar Dec 07 '14 18:12 sylvinus

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.

christianmalek avatar Dec 09 '14 08:12 christianmalek

Is this dead?

digitalsanity avatar Apr 01 '20 01:04 digitalsanity

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.

gordonwoodhull avatar Apr 01 '20 04:04 gordonwoodhull