Two lines of labels using Chart.js

If you want to have two lines of labels using Chart.js on the x-axis, you can use a 2-dimensional array:

javascript
const data = {
    
    labels: [['00:00', 'Today'], '04:00', '08:00', '12:00', '16:00', '20:00', ['00:00', 'Tomorrow']],
    datasets: [{  
        data: [1, 1, 1, 1, 1, 1, 1]
    }]
              
}

The result will be something like:

terminal
   |
   |
   |
 1 |--------------------------------------------
   |
   -----------------------------------------------
   00:00  04:00  08:00  12:00  16:00  20:00  00:00   
   Today                                   Tomorrow

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.