I am using a simple bar chart from chartJS representing time passed (in seconds). I was wondering if I could overwrite every bar's value to an array I could provide. So instead of having 10983 I could write whatever I want, like 03:03:03 and another hh:mm:ss for the second bar and so forth.
Does anyone have an idea ?
Here is the chart I have so far

dataset = [{
data: arrayData,
backgroundColor : "#265d96" //#3e95cd //#265d96
}];
param = {
type: "bar",
data: {
datasets: dataset,
labels: arrayDesc
},
options: {
responsive: true,
maintainAspectRatio: true,
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
},
legend: {
display: false
},
tooltips: {
enabled: true
},
animation: {
animateScale: true,
animateRotate: true
},
plugins:{
labels:
{
render: () =>{},
display : false
}
}
}
};
You can use a custom tooltip callback:
tooltips: {
callbacks: {
label: (ttItem) => (new Date(ttItem.yLabel*1000).toISOString().substring(11, 19))
}
}