Level 16
Use the configuration to define it
var chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
scales: {
x: {
type: 'time',
time: {
unit: 'month'
}
}
}
}
});
Docs
https://www.chartjs.org/docs/master/axes/cartesian/time#time-units
1 like