mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +02:00
Merge pull request #3063 from chartjs/fix/2631
Handle possibility of a undefined arc element in the doughnut chart
This commit is contained in:
commit
7628d4c8f2
@ -46,7 +46,7 @@ module.exports = function(Chart) {
|
||||
var meta = chart.getDatasetMeta(0);
|
||||
var ds = data.datasets[0];
|
||||
var arc = meta.data[i];
|
||||
var custom = arc.custom || {};
|
||||
var custom = arc && arc.custom || {};
|
||||
var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
|
||||
var arcOpts = chart.options.elements.arc;
|
||||
var fill = custom.backgroundColor ? custom.backgroundColor : getValueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);
|
||||
@ -253,6 +253,10 @@ module.exports = function(Chart) {
|
||||
}
|
||||
});
|
||||
|
||||
/*if (total === 0) {
|
||||
total = NaN;
|
||||
}*/
|
||||
|
||||
return total;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user