【发布时间】:2014-01-21 14:39:55
【问题描述】:
我正在画这个饼图:
使用此代码:
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
}
}
}]
}
有没有办法将所有值的总和添加到甜甜圈的中心?像这样:
【问题讨论】:
-
此功能在github中是一个未解决的问题
-
@SaravanaKumar 所指的问题已关闭。你现在可以使用这个插件了:github.com/ciprianciurea/chartjs-plugin-doughnutlabel
标签: javascript html5-canvas chart.js