Possibility for adding multiple label-arrays for multiple dataset doughnut diagrams
See original GitHub issueWhen creating a doughnut diagram with multiple rings there seems to be no option for adding different arrays of labels. One array for each dataset. For example in this chart a option, so every item has it’s color name as label (tooltip):
var ctx = $("#myChart");
var myChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["Green", "Yellow", "Red", "Purple", "Blue"],
datasets: [
{
data: [1,2,3,4,5],
backgroundColor: [
'green',
'yellow',
'red',
'purple',
'blue',
],
},
{
data: [6,7,8],
backgroundColor: [
'black',
'grey',
'lightgrey'
],
},
]
},
options: {
responsive: true,
legend: {
display: false,
}
}
});
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:9 (2 by maintainers)
Top Results From Across the Web
How to Add Multiple Text Labels Stacked in Doughnut Chart in ...
How to Add Multiple Text Labels Stacked in Doughnut Chart in Chart JSIn this video we will explore how to add multiple text...
Read more >How to create a Multiple Donuts chart - Datawrapper Academy
A multiple donuts chart is useful when you want to show proportional parts of multiple wholes and want to give the reader an...
Read more >How to add a second set of labels to a Chart.js doughnut chart?
Add a labels array to both of the datasets var config = { type: 'doughnut', data: { datasets: [ { data: [124,231,152,613,523], ...
Read more >Donut Charts - Salesforce Help
Use a donut chart when you have multiple groupings and want to show not only the proportion of a single value for each...
Read more >Doughnut Chart in Excel - GeeksforGeeks
Inserting Charts in Excel: · We want to represent multiple datasets on a single chart. · Each dataset has a maximum of 6-7...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
Adding some extra data to the datasets and then changing the tooltip
label
callback works: https://jsfiddle.net/moe2ggrd/1/Hope you don’t mind, I’m just going to copy the code out of that fiddle and paste it here in case it disappears since it’s really useful!