question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

minBarLength Stacked bar chart not working

See original GitHub issue

Hello there,

This is an old annoying bug, that still exists in latest version, the minBarLength doesn’t work as expected in case of Stacked bar, the minBarLength doesn’t apply to each dataset, but instead it applies to the whole bar, which cause overlapping, between bars.

Please fix this, it’s really unusable for many usecases.

You’ll find bellow a reference with the illustrated problem.

Thank you for your hard work.

======================================= _Originally posted by @tomzag in https://github.com/chartjs/Chart.js/issues/5741#issuecomment-750866201_

There seems to be a problem with stacked bar charts.

Here for example a horizontal stacked bar chart: Bildschirmfoto 2020-12-24 um 13 14 44

The minBarLength works but the stacked version isn’t respecting it and the bars overlap.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Kit-pcommented, Oct 6, 2022

That’s weird, but it is expected that the datalabel plugin does not work with a local version of Chart.js. You installed an actual release of Chart.js as a workaround, which could be the cause of the labels not being in center, not 100% sure about that though.

As there is no test on the integration with other plugins, this is quite hard for me to debug. I will finish off the remaining work in these 2 days and push it to my fork, so we can see how it works when properly installed as a node module.

1reaction
kurklecommented, Oct 4, 2022

I don’t think current behavior is valid for any use case, so my vote is for just fixing it, without new options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chart.js "minBarLength" not working as intended?
I can see there is a "minBarLength" property which the docs says to "Set this to ensure that bars have a minimum length...
Read more >
Bar Chart | Chart.js
A bar chart provides a way of showing data values represented as vertical bars. It is sometimes used to show trend data, and...
Read more >
Explore recipe: Working with stacked charts - Zendesk help
A stacked chart breaks down each bar or column in a chart into subsections ... The chart shows the number of tickets by...
Read more >
[Solved]-Chart.js "minBarLength" not working as intended?
Coding example for the question Chart.js "minBarLength" not working as intended? ... Colors for stacked bar on multi-series line/bar chart are not working...
Read more >
Stacked Bar Charts - Salesforce Help
Use a stacked bar chart when you have multiple groupings and are interested in the proportions between values in each grouping, as well...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found