Format chart.js x labels
Solution 1 label filter: According to the filtering labels sample you can set a function to define what should be displayed:
options: {
scales: {
x: {
display: true,
ticks: {
callback: function(dataLabel, index) {
// Apply logic to remove name of the month
return dataLabel
}
}
},
y: {
display: true,
beginAtZero: false
}
}
}
Github source of the example
Solution 2: You could prepare your labels array beforehand. Filter the occurence of all the upcoming mentions and feed this array to chart.js.