Chartjs-How to format x-axis time scale values in Chart.js v4.2.1

1👍

Going thru the date-fns documentation (v2), the format string to use to have those date string representation is the following:

EEE dd.MM

HEre is the link to date-fns doc, about formatting: https://date-fns.org/v2.29.3/docs/format

About zooming, if you are using chartjs-plugin-zoom, it doesn’t change the scale configuration and in your case the time unit.
But I think you can use the onComplete (or onProgress) hooks of the plugin to change the scale config at runtime, using your logic to change the time unit.

Leave a comment