Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug stacked bar #5141

Closed
ybarbaria opened this issue Jan 12, 2018 · 8 comments
Closed

Bug stacked bar #5141

ybarbaria opened this issue Jan 12, 2018 · 8 comments

Comments

@ybarbaria
Copy link

Description
I noticed this bug [I think it would be a BUG], when I set line bar stacked with only one element and it's data = [-25.6], the chartjs draw only one bar horizontally extended.

Expected Behavior
Bar stacked to the bottom

image

Current Behavior
The bar is extended horizontally.

image

Possible Solution
I fix this bug in my code by setted the data with empty values.. data = [-25.6,,,,]

Steps to Reproduce (for bugs)

Configuration of the dataset=>

backgroundColor:"#f57f17"
borderWidth:1
data:[-25.6]
label:"Order Sell"
type:"bar"
yAxisID:"y-axis-0"

Configuration of the y axes =>

 gridLines: {
        display: true     }

Configuration of the x axe =>

stacked:true
    gridLines: {
        display: true, 
        offsetGridLines: true
     }

Environment
Chartjs 2.6.0/2.7.0/2.7.1
Version 63.0.3239.132
Windows 10 64bit

@simonbrunel
Copy link
Member

This is fixed in master (#4994) and will be release in 2.8. You can verify that it works with https://rawgit.com/chartjs/chartjs.github.io/master/dist/master/Chart.min.js

@ybarbaria
Copy link
Author

Thx @simonbrunel !

@MaffooBristol
Copy link

I have this same issue:

image

The suggested new version that will be in 2.8 has helped a lot, but still has some bugs:

image

You can probably see here that some of them float, and some of them seem to be flying off into the ether. The one in the very top right has a value of 17, so should be at the bottom, not filling the full vertical space.

Still, I'm so so very relieved to see there's something that at least 95% fixes this issue 👯

@MaffooBristol
Copy link

@simonbrunel When is 2.8 scheduled for release, may I ask? I never really know where to look or who to ask for this kind of information.

@MaffooBristol
Copy link

MaffooBristol commented Feb 23, 2018

Just looked into it a bit more, and it seems it's still having issues somewhat:

image

It starts off well, but then something (and I'm not sure what) makes it go a bit odd and do big wide floating bars.

Ps. This is when it's as "linear" distribution. The issues aren't quite as noticeable when it's "series".

@ybarbaria
Copy link
Author

@MaffooBristol
You can follow the advancement of the v2.7.2
[(https://github.com/chartjs/Chart.js/milestone/14)]
And the Version 2.8
https://github.com/chartjs/Chart.js/milestone/17

@MaffooBristol
Copy link

MaffooBristol commented Feb 23, 2018

Okay, thanks.

Another quick screenshot showing far more data and how mangled it looks:

image

Edit: Discovered why it was coming out so funkily. Turns out that all the data needs to be padded with zeroes in order to get it to work. This is a separate issue entirely though (#5072)

@simonbrunel simonbrunel removed this from the Version 2.7.3 milestone Oct 15, 2018
@simonbrunel
Copy link
Member

@ybarbaria you didn't confirm that this issue was fixed? I will close it for now per my last comment but feel free to reopen if you still experience this bug in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants