1👍
If i understand correct, you want to show only 5 labels in your x-axis (1, 2, 3 ,4, second). Try this one:
var options = {
scales: {
xAxes: [{
afterTickToLabelConversion: function(data){
var xLabels = data.ticks;
xLabels.forEach(function (labels, i) {
if (i % 1000 != 0){
xLabels[i] = '';
}
});
}
}]
}
}
- [Chartjs]-How to update chartjs2 option (scale.tick.max)
- [Chartjs]-Develop Actigram with javascript (D3, chart, plotly…)
Source:stackexchange.com