Open gordonwoodhull opened 3 years ago
Btw, the answer provides a great example of why it's nice that we exposed all the private methods on upgrading to ES6 in v4. It uses both PieChart._buildArcs()
and PieChart._labelPosition()
and it would be a lot messier without them.
It's pretty common to want to add or change the stuff that goes into the pie slices. Right now you have to calculate the position yourself, and animations don't come out right.
We use
g
elements for the slices themselves, but this doesn't really help for adding images at the center where labels would go, as asked in this SO question:https://stackoverflow.com/questions/67340109/how-to-add-icons-in-dc-js-piechart-slices-instead-texts
This has come up before. There are other charts where we put the label in a
g
and it is helpful.