Doughnut: write something in the center
See original GitHub issueHi,
I’m not very familiar with the canvas
, I’d like to write something in the center of the doughnut and I’ve tried to use the ctx.fillText()
without success, once I call the chartjs API it erases my text, and if I try to fillText after the call it output nothing.
I’d like to achieve something similar to this:
Am I doing something wrong with my try or is just no way to do it using chartjs?
Thanks
Issue Analytics
- State:
- Created 10 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
How to Add Text and Value at the Center of a Doughnut Chart ...
What type of charts can you make with Chart.JS? With chart js you can make line chart, bar chart, pie chart, doughnut chart,...
Read more >How to Add Multiple Text Labels In Center of Doughnut Chart ...
We cover the code in chart js but also what truly happens and why something happens when we write a line of code....
Read more >How to add text inside the doughnut chart using Chart.js?
Here is a small script you can use to dynamically place any amount of text in the middle, and it will automatically resize...
Read more >How can I add text in the centre of a Donut Chart - Edureka
To get the label center in donut chart, Select the 2nd pie chart and go to label, Click on automatic next to alignment....
Read more >Centering Text in Donut - Highcharts official support forum
I was wondering if there was a proper way to center two lines of text inside a donut. I have tried a combination...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can easily achieve this now with plugins:
You can have more info on this there: http://www.chartjs.org/docs/latest/developers/plugins.html#using-plugins
This worked for me by revising this