Open json2d opened 5 years ago
I have a use case where I need to do some extra formatting to the text for the outlabel.
So for that I'm thinking it could be done with:
var chart = new Chart('outlabeledChart', { type: 'outlabeledPie', data: { labels: [/* ... */], datasets: [/* ... */] }, options: { plugins: { outlabels: { text: (label, percentage, value) => myCustomFormatter(value), } } } });
outlabels: { text: function(label) { const v = parseFloat(label['percent']) * 100; return `${v.toFixed(2).replace('.', ',')}%`; }, }
I have a use case where I need to do some extra formatting to the text for the outlabel.
So for that I'm thinking it could be done with: