I'd like to draw a line chart by Chartjs with data by day, but label by month.
If label is displayed by day, then there are a lot of points. So, I'd like to display label by month instead of by day. For example:
Someone could teach me how to do that?
Thank you.
Just config your xAxes->time property as:
unit: 'month'
xAxes: [{
type: 'time',
position: 'bottom',
time: {
displayFormats: {'day': 'MM/YY'},
tooltipFormat: 'DD/MM/YY',
unit: 'month',
}
}],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With