Chart.js: minBarLength not working at all.

Created on 17 Apr 2019  ·  4Comments  ·  Source: chartjs/Chart.js

Expected Behavior

Bars should be a minimum height to be visible when value = 0.

Current Behavior

Bars are not set to the minimum bar length specified in the config.

Steps to Reproduce (for bugs)

See simple code example at https://jsfiddle.net/u3w749d1/

bug

Most helpful comment

Actually the minBarLength behaviour is not unvariant for dataset values. See here, where:

  • large numbers seems to break the behaviour
  • dataset values order/ datasets order seem to vary the behaviour

All 4 comments

Its not supposed to work in Chart.js v2.3.0 that your fiddle is using.
Works fine with v2.8: https://jsfiddle.net/37Lsxdkh/

Hmm, ok, well, it wasn't supposed to be this old version (forked an example from someone else) but case still stands because the version we're using was 2.7.3 so I'll update it. Thanks!

It seems the problem arises when in the dataset the 0 value is missing

Actually the minBarLength behaviour is not unvariant for dataset values. See here, where:

  • large numbers seems to break the behaviour
  • dataset values order/ datasets order seem to vary the behaviour
Was this page helpful?
4 / 5 - 1 ratings

Related issues

akashrajkn picture akashrajkn  ·  3Comments

benmccann picture benmccann  ·  3Comments

SylarRuby picture SylarRuby  ·  3Comments

bytesnz picture bytesnz  ·  3Comments

lbowers picture lbowers  ·  3Comments