[Chartjs]-Plot a bar chart.js time series

12๐Ÿ‘

โœ…

I had the exact same issue when displaying a bar chart with time as the X axes.

Inside your xAxes you need to add an additional configuration option:

xAxes: [{
    offset: true
}]

Description from the ChartJS documentation:

If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to true in the bar chart by default.

ChartJS Documentation Cartesian

Leave a comment