24👍
✅
Add the following under options:
options: {
scaleShowValues: true,
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}]
}
}
8👍
Some of the properties will be useful.
options: {
scales: {
xAxes: [{
ticks: {
maxRotation: 50,
minRotation: 30,
padding: 10,
autoSkip: false,
fontSize: 10
}
}]
}
}
autoSkip
: To show all labelsmaxRotation
: Rotation for tick labels (Only applicable to horizontal scale)minRotation
: Rotation for tick labels (Only applicable to horizontal scale)padding
: Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.fontSize
: font size
Hope this help!
In order to a large number of record needs to plot on fixed-sized view, I would recommend to use Logarithmic Scale.
2👍
Updating @fiveelements’ answer for Chart.js v3.7.1+:
options: {
scales: {
x: {
ticks: {
autoSkip: false
}
}
}
}
Source:stackexchange.com