I'm using Chart.js (documentation), but I can't seem to set a background color to the Donut path. It isn't even mentioned in the docs.
What I'm trying to achieve:
Current code:
var meterInvoicesData = [
{
value: 75,
color: '#22d319'
},
{
value: 25, // rest
color: 'transparent' // invisible (setting this as background color will animate it too)
}
];
var meterOptions =
{
percentageInnerCutout : 80,
animationEasing : 'easeInQuint'
};
var meterInvoices = new Chart(document.getElementById('meterInvoices').getContext('2d')).Doughnut(meterInvoicesData,meterOptions);
UPDATE: I currently solved it by using a duplicate Donut (2nd canvas) with a value of 100, no animation and my desired (background-) color, and positioned it absolute, underneath the 1st one.
However, this is a nasty trick, and very inefficient, so I'm still hoping for a correct answer.