#103373

Hi,

To format the x-axis label`s values you can use the formatFunction. Here is an example for setting the value to hh:mm :

formatFunction: function (value) {

const hours = value.getHours().toString().padStart(2,0);

const minutes= value.getMinutes().toString().padStart(2,0);

return hours + ':' + minutes;
}

You can centre the x-axis centred on the hour with the baseUnit set to ‘hour’.
The gap between the hours can be set with the unitInterval set to 1. This will make the gap to be one hour.

To set the starting point to be yesterday`s hour you can create a date variable and set it to the minValue:

const yesterday = new Date();
yesterday.setDate(yesterday.getDate() -  1);

you can set the minValue to yesterday

If you need further assistance, do not hesitate to ask!

Best Regards:
Svetoslav Borislavov

Smart UI Team
https://www.htmlelements.com/