1๐
I believe that this is a bug with the current Chart.js version.
As a workaround you could use a callback at the tick of you xAxes like this:
options: {
scales: {
xAxes: [{
stacked: true,
ticks: {
min: 0,
callback: function(value, index, values) {
return value + 7;
}
}
}],
...
For more details on callbacks have a look at the documentation.
- [Chartjs]-Why is the background black when with Chartjs export to a image
- [Chartjs]-Displaying JSON data in Chartjs
1๐
options: {
scales: {
xAxes: [{
display: true,
ticks: {
suggestedMin: 7
}
}]
}
}
- [Chartjs]-Use JSON file with chart.js
- [Chartjs]-Apply/Register conflicting plugins to different charts
1๐
This will work for both Vertical and Horizontal
options:{
scales: {
xAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100
}
}],
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100
}
}],
},
}
Source:stackexchange.com