I have a problem with the graphics of CHART.JS. When I put the time interval of 2 years, some labels of the months overlap. I want all the labels to appear, the time interval doesn't matter.
var g = new Chart(ctx, {
type: 'bar',
data: {
labels: labelsHeader,
datasets: listData,
},
options:{
maintainAspectRatio: false,
}
});
Add the following under options:
options: {
scaleShowValues: true,
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}]
}
}
Edit (2024): The scale configuration has changed in the newer versions. Now, it looks like the following:
options: {
scales: {
x: {
ticks: {
display: true,
autoSkip: false
}
}
}
}