3

In chart.js, is it possible to display the full date (e.g 24.04.2020) when the time scale is set to hours. This should only happen at midnight.

So for example you have the hours in the image and at "00" (midnight) there should be a label with "24.04.2020 00:00".

Graph image

These are my current settings regarding time:

time: {
    minUnit: "minute",
    tooltipFormat: "d.MM.yyyy HH:mm",
    displayFormats: {
        minute: "HH:mm",
        hour: "HH",
        day: "d.MM ",
        month: "MM yyyy",
        year: "yyyy"
    }
}
                        
nixon
  • 1,952
  • 5
  • 21
  • 41
ComanderKai77
  • 460
  • 6
  • 14
  • I am using https://www.chartjs.org/ – ComanderKai77 Apr 25 '20 at 00:06
  • I had a very similar problem and I would still be very interested in a solution to yours. Maybe this helps someone: https://stackoverflow.com/questions/71133695/how-to-set-vertical-lines-for-new-day-on-x-axis-in-chartjs-v3-x – Max J. Feb 16 '22 at 17:56

0 Answers0