5👍
✅
Use Chart.scaleService.updateScaleDefaults.
Chart.scaleService.updateScaleDefaults('category', {
ticks: {
callback: function (tick) {
return tick.substring(0, 3);
}
}
});
And add this code in your xAxes
options.
tooltips: {
callbacks: {
title: function (tooltipItems, data) {
return data.labels[tooltipItems[0].index]
}
}
}
Source:stackexchange.com