Hello I would like to add a text in the center of the doughnut (e.g. Total count ) using syncFusion in my functional component. I am able to generate the Doughnut however unable to add text in the center. Can someone give me a example demoing the same in functional component of React JS. similar to the image displayed below.
Thanks in Advance.
Hi Randhir,
Greetings from Syncfusion.
We suggest you to use annotation to achieve your required scenario. Please check with the below snippet and sample.
<AccumulationChartComponent > <AccumulationAnnotationDirective content="<div>$70</div>" region='Series' coordinateUnits='Pixel' x='50%' y='50%'> </AccumulationAnnotationDirective> </AccumulationAnnotationsDirective> |
Kindly revert us if you have any concerns.
Regards,
Durga Gopalakrishnan.
Hi Durga,
Thanks for the response. I was able to get the text in center using Annotation . 1 quick question how do I make my text multiline. If I add a </br> tag in div of content . The text in the next line is not centered. Please see the image below. Also how do I change the font Size I tried passing style attribute in the div tag but it doesn't seems to work.
Thanks again.
Hi
Durga Gopalakrishnan , I was able to add text in the center , how do I increase the width of the legend. I tried to alter the legend setting but it doesn't works. Looking to hear back from you.
Thanks
Randhir