So I am creating a line chart where I have displayed the x axis with time in ‘HH:mm’ format but in the tooltip I want to show the time in ‘HH:mm:ss’. If I am trying to customize my tooltip it takes every second as 0. Is there any way to customize the tooltip so that the seconds are visible properly?
x-axis: ["11:05", "11:06", "11:06", "11:07", "11:07", "11:08", "11:08", "11:09"]
If I convert it to seconds then the data will be ["11:05:30", "11:06:00", "11:06:30", "11:07:00", "11:07:30", "11:08:00", "11:08:30", "11:09:00"] but I need to display my x axis only in hours and minutes.
callback function:
tooltips: {
callbacks: {
title: (tooltipItems, data) => {
let label = tooltipItems[0].label;
label = momentInstance(labelText, 'hh:mm:ss').format(MMM DD - hh:mm:ss A');
return label;
},
}
It is displaying as "11:05:00", "11:06:00", "11:06:00", "11:07:00", "11:07:00", "11:08:00", "11:08:00", "11:09:00" for each data point.