Label Text Centered in Donut Chart
Hey--
I've been fiddling around with the various options and interpolation, but I cannot seem to get the label text to stay centered in the middle of the donut chart. I can get a position that passes for centered, but the position of the text changes and the donut chart values change.
How do I place a label in the absolute center of a donut chart?

Hi there. You need to use a combination of Styling and the Chartist Draw events:
http://jsbin.com/buhoza/1/edit?css,js,output
Closing this for now, please comment if you need anything else.
The above shown jsbin does not work :( I'm trying to work this solution out but it seems to be related to new version of Chartist. Could someone help me out here? ( @gionkunz )
I found out playing around labelOffset, labelDirection and labelPosition might do the trick. But still no luck. Anyone care to help please?
Hi, I've updated the bin http://jsbin.com/buhoza/2/edit?css,js,output
Thank you for the bin! It's perfect if you don't want to show a label for each of the slices. Is there a possibility to add a new label like that while keeping the labels corresponding to each slice?
Hey it's may be too late but it can help the other person . I was inspired by @gionkunz 's jsbin for that donut who displays the percentage of each value when we mouse over a slice. Hope i can help someone :) https://jsfiddle.net/k9mw7x9q/2/
(sorry for my English, it's not my native language)
None of the above examples worked properly for me, the label would not vertically align. I found the answer here: https://stackoverflow.com/a/35394857/6036546
.ct-label {
dominant-baseline: central; /* This is the key difference from the other examples */
text-anchor: middle;
font-size: 80px;
}
new Chartist.Pie('#chart', {
series: [80]
}, {
total: 100,
donut: true,
donutWidth: 20
}).on('draw', (context) => {
if (context.type === 'label') {
context.element.attr({
dx: context.element.root().width() / 2,
dy: context.element.root().height() / 2
});
}
});