0👍
Try this options:
hover: {
animationDuration: 0
},
animation: {
onComplete: function () {
var ctx = this.chart.ctx;
var metaInfo = null;
ctx.font = '12px "Helvetica Neue", Helvetica, Arial, sans-serif';
ctx.fillStyle = 'gray';
ctx.textAlign = "center";
ctx.textBaseline = "bottom";
_.forEach(this.config.data.datasets, function (dataset, i) {
metaInfo = dataset._meta[Object.keys(dataset._meta)[i]];
_.forEach(metaInfo.data, function (bar) {
ctx.fillText(scope.data[bar._index], bar._model.x, bar._model.y);
});
})
}
},
tooltips: {
enabled: false
}
_
– lodash library (you can use forEach
like your code above)
I am using version 1.1.1 of angular-chart.js
- [Chartjs]-NG2-Charts Can't bind to 'datasets' since it isn't a known property of 'canvas'
- [Chartjs]-Is there a way in a donut Chart.JS to show a % out of 100
Source:stackexchange.com