0👍
You can define offset: true
on the x-axis as follows:
options: {
scales: {
xAxes: [{
offset: true
}]
}
}
offset
: Iftrue
, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set totrue
for a bar chart by default.
- Chartjs-Trying to create chartjs constructor
- Chartjs-Chart.js – problem with label on the right hand
Source:stackexchange.com