Chartjs-How to solve right order on x axis in charts.js

0👍

As reported in the comment, you scales config is not correct.
I have changed it (there were other misconfigs) and the following config should be correct:

 scales: {
   x: {
     type: 'time',
     time: {
       displayFormats: {hour: 'HH:mm'},
     },
     grid: {
       color: 'black'
     },
     ticks: {
       font: {size: 40},
       color: 'black',
     },
   },
   y: {
     type: 'linear',
     grid: {
       color: 'black'
     },
     position: 'left',
     ticks: {
       color: 'black',
       max: 1,
       min: 0
     },
     title: {
       display: true,
       color: 'black',
       text: 'Leistung (WATT)'
     },
   },
  },

Leave a comment