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.

Make minBarLength work for data that's only <= 0

See original GitHub issue

Feature Proposal

If I set minBarLength = 1 and I have a bar chart with data [0, 12.5], the first bar will be displayed as a very short bar:

Screenshot 2020-01-18 at 10 19 32

If, however, my data is [0, -12.5], the first bar is invisible:

Screenshot 2020-01-18 at 10 17 50

Feature Use Case

This would be great for bar charts that may display only data thats <= 0.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
nijakobiuscommented, Jan 18, 2020

This is how the minBarLength is drawn right now: B0CCF0BE-C7CA-41C2-BDB5-ED872A227EC0

This is what I imagine might be better, although I feel that this might be rather complex to implement: 6D818D1E-BD7A-4771-AA94-13551A4D4AB4

PS: This is weird: on desktop, the photos are rotated by 90° but not on mobile… apologies for that

1reaction
kurklecommented, Jan 19, 2020

Both seem incorrect to me, minBarLength should be min length in any direction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chart.js minBarLength work for stacked bars? - Stack Overflow
We have currently tried adding the minBarLength attribute to all datasets, but it apparently only seems to affect the bottom-most stacked bar.
Read more >
Developers - Make minBarLength work for data that's only <= 0 -
If I set minBarLength = 1 and I have a bar chart with data [0, 12.5] , the first bar will be displayed...
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 >
Excel Data Bars Conditional Formatting with examples - Ablebits
Data Bars in Excel are an inbuilt type of conditional formatting that inserts colored bars inside a cell to show how a given...
Read more >
[Solved]-Show bar with zero value in ChartJs v2-Chart.js
this.chart = new Chart( ctx, { type: 'horizontalBar', data: this.data.chartdata, ... Keep in mind that this will work for values close to 0,...
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