Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

minBarLength fails for some datasets

Open nmz787-intel opened this issue 2 years ago • 2 comments

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

nmz787-intel avatar Jul 19 '22 03:07 nmz787-intel

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 avatar Jul 19 '22 05:07 kurkle

@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

nmz787-intel avatar Jul 19 '22 21:07 nmz787-intel