Open
Description
Would you like to work on this feature?
- Check this if you would like to implement a PR, we are more than happy to help you go through the process.
What problem are you trying to solve?
Trying to add text inside the bubble same like this:
Describe the solution you'd like
A way to add text like a label field could be added by which a text is provided for bubble
Describe alternatives you've considered
No response
Documentation, Adoption, Migration Strategy
No response
Activity
SHIVA-6699 commentedon Mar 11, 2024
i want insert text inside of the Doughnut is it possible
<Doughnut
data={data}
style={{ width: "400px", height: "400px" }}
options={{
cutout: "80%",
plugins: {
title: {
text: "Actual",
},
},
}}
>
dkkazmierczak commentedon Jun 7, 2024
I was looking for a solution and I found this plugin chartjs-plugin-datalabels - Link.
Example of the bubbles chart here: link
Installation
npm install chartjs-plugin-datalabels --save
Import
import ChartDataLabels from 'chartjs-plugin-datalabels';
Register it below just like other plugins
Chart.register(ChartDataLabels);
And here is my example:
So in options -> plugins -> datalabels -> formatter you can return the label that you want. And you have also option to choose a color, font weight, font size etc.