[Chartjs]-Setting min and max values chart.js

1πŸ‘

βœ…

It is because you only have 7 labels on the x axis.

If you add more like so by changing labels from:

labels: [1,2,3,4,5,6,7],

to:

labels: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]

It works fine.

Remember you are asking for a max of 20 but there are only 7 so it can only display 7.

Leave a comment