[Chartjs]-Unaligned x scales for two Chartjs-chart types with the same configuration – only difference is "chart type" (bar/line)

2πŸ‘

βœ…

This is because the bar chart sets the offset property on the x axis scale to true.

https://www.chartjs.org/docs/3.8.0/axes/cartesian/category.html#common-options-to-all-cartesian-axes

So to align them you either have to set it to false for the bar chart or to true for the line chart

Leave a comment