0👍
You’ve added a wrong value to the ‘max’ config at scales. Change it to
max: labels[labels.length - 1]
0👍
Unless until your Data is an array of new Date() format, Chartjs can’t interpret data to create intervals or set min and max. I had the same issue. Only way , I was able to fix is by adding new Date() before time . If you don’t have dates and as it is past 24 hour data, Prepare data array by adding current date and yesterdays date.
- Chartjs-How to set min max for x axis depend on data with Chartjs and Spring Boot?
- Chartjs-Using data structures in chartjs
Source:stackexchange.com