Sunday, May 19, 2024
101
rated 0 times [  104] [ 3]  / answers: 1 / hits: 18587  / 11 Years ago, fri, january 3, 2014, 12:00:00

I'm drawing this pie chart:



enter



using this code:



dxPieChart: {
dataSource: dsAlarmsBySeverity,
size: {
width: 275,
height: 150
},
palette: ['#FFFF00', '#FF9900', '#CC3300', '#33CC33', '#0066FF'],
legend: {
backgroundColor: '#FCFCFC',
border: {
color: 'black',
width: .5,
visible: true,
cornerRadius: 10
},
verticalAlign: 'middle'
},
series: [{
type: 'doughnut',
argumentField: 'severity',
valueField: 'count',
label: {
visible: false,
font: {
size: 16
},
connector: {
visible: true,
width: 0.5
},
position: 'columns',
customizeText: function(arg) {
return arg.argumentText
}
},
border: {
color: 'black',
width: .5,
visible: true
},
hoverStyle: {
border: {
color: 'black',
width: .5,
visible: true
}
}
}]
}


Is there a way to add the sum of all values to the center of the donut? Like so:



enter


More From » html5-canvas

 Answers
21

There is a plugin for what you want to do: https://github.com/ciprianciurea/chartjs-plugin-doughnutlabel


[#73387] Thursday, January 2, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
harleyterryp

Total Points: 290
Total Questions: 92
Total Answers: 95

Location: Montenegro
Member since Sun, May 7, 2023
1 Year ago
;