I have the following Bubble chart generated in Chart.js. Note the xAxes labels are already date objects.
Here is the current configuration of the xAxes.
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'second',
}
}],
How can I display the xAxes labels in format YYYY-MM-DD HH:mm:ss
?
You can use property displayFormats
according to Display Formats from Chart.js documentation. See Moment.js for the allowable format strings.
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'second',
displayFormats: {
second: 'YYYY-MM-DD HH:mm:ss'
}
}
}]
}