[Chartjs]-How to prevent empty bars from taking up width in Chart.js bar chart

4πŸ‘

βœ…

@Drarig29’s answer is correct β€” null values plus skipNull removes the extra bars. However, if you’re using barPercentage, your bars will fluctuate in width (varies from being a 1/5th of the width to 100% of the width, in my case, depending on how many bars there are), so you must set a maxBarThickness on the dataset to prevent them from growing.

Leave a comment