Using Chart.js qnd Angular.chart, I have a stacked chart in which I'm using different colors, I want to put the number of each value inside the cart, so I'm making use of the Plugin Datalabels.
The problem is that my chart looks like this:
Where I have the dark blue I'd like the numbers to be white. But don't know how to achieve this.
This is my code:
$scope.Options = {
...
plugins: {
datalabels: {
color: '#171d28',
anchor: 'center',
align: 'center',
clamp: true
}
}
};
I tried putting the colors in an array, like this:
$scope.Options = {
...
plugins: {
datalabels: {
//The first 2 colors as dark and the third one as white
color: ['#171d28', '#171d28', '#fff'],
anchor: 'center',
align: 'center',
clamp: true
}
}
};
But this way it apply the changes by bar! not by the color section.
It says in the datalabels page that you can add functions, but not very sure how: Link to datalabels page about color
Any help is welcome, Thanks in advance!