Reputation: 4258
I am using the chart.js to generate a chart. All works fine !
But how can I format the tooltip information? It should be: 28.04.2020 - 05:00
Upvotes: 4
Views: 1675
Reputation: 26150
You need to define time.tooltipFormat
for your xAxis
.
See Moment.js for the allowed format tokens.
options: {
...
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'hour',
tooltipFormat: 'DD.MM.YYYY - HH:mm'
}
...
}]
}
...
}
Upvotes: 7