Hi All -
I found a thread in stackoverflow discussing this. From what I can see, they set an option - namely animation. However, I have no idea how to translate it into UD/PS. Initially, I was using NivoChart, but I cant figure out how to assign specific color if a condition is met. Your help is much appreciated.
https://jsfiddle.net/x75ehyco/1/
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
}
}]
},
animation: {
duration: 1,
onComplete: function() {
var chartInstance = this.chart,
ctx = chartInstance.ctx;
ctx.font = Chart.helpers.fontString(Chart.defaults.global.defaultFontSize, Chart.defaults.global.defaultFontStyle, Chart.defaults.global.defaultFontFamily);
ctx.textAlign = 'center';
ctx.textBaseline = 'bottom';
this.data.datasets.forEach(function(dataset, i) {
var meta = chartInstance.controller.getDatasetMeta(i);
meta.data.forEach(function(bar, index) {
if (dataset.data[index] > 0) {
var data = dataset.data[index];
ctx.fillText(data, bar._model.x, bar._model.y);
}
});
});