Chart.js
Chart.js copied to clipboard
minBarLength fails for some datasets
Expected behavior
there should be a minimum bar length, if this property is specified
Current behavior
some datasets fail to show any bar length, like this: https://codepen.io/nmz787/pen/zYWZZXG
Reproducible sample
https://codepen.io/nmz787/pen/zYWZZXG
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
This makes hovering over the bar for the tooltip popup a little tricky and maybe unintuitive for new users to my page/site.
chart.js version
3.8.0
Browser name and version
chrome, Version 103.0.5060.114 (Official Build) (64-bit)
Link to your project
No response
Assuming you still want it to not start from zero, you could use the grace
option for the scale to make the bars visible.
@kurkle hmm, that works, but when combined with
ticks: {
stepSize: 1
}
(since my data is whole numbers only, and fractions don't make sense) things look goofy in a different way: https://codepen.io/nmz787/pen/XWEMOqj