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 graph with overlapping bar breaks when having only 2 data points #19874

Open
GeorgeSedhom0 opened this issue Apr 28, 2024 · 4 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@GeorgeSedhom0
Copy link

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5JALZW0A0JAvm-uTvkaqTKUasWgDcAhgBsArsw5dYeKgCcIVQrADaJdAMGxoEpkQBEABlOLBAIwkqA4hJBmAtAEZz5gKRXdpOxUAdQgAEzAACzMATgBWX2tSUIkwCSItLXcWWHcAXWytACZswtz8_3QKajpA2n9Of31BIxNYU3c_AyVUgGMAazMwYFSpToNAkPCots8fMcFk1PTM7LyC4thS8q6qkVpa-sSm0haRU0L50jxegbahkcv0CbDIs1mEithFtO0VnPztBstolKsIavY6oIGuhcih2ABuIA

Steps to Reproduce

Clicking the link is sufficient to reproduce the issue.

Current Behavior

The graph breaks and shows no bars or legends.

The problem exists only when each of the series have two datapoints. When there are more datapoints, the bars are displayed (see MWE).

Expected Behavior

The expected behaviour is that there are two stacked bars (with two series in each bar). And behind the stacked bars, there is one unstacked bar.

Environment

- OS: Manjaro Linux, Windows 11
- Browser: Brave 1.65.114, Firefox 124.1.0
- Framework: -

Any additional comments?

No response

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Apr 28, 2024
@helgasoft
Copy link

removing barGap maybe ?

@GeorgeSedhom0
Copy link
Author

GeorgeSedhom0 commented Apr 29, 2024

removing barGap maybe ?

I need the gap since I'm trying to have the bars on series 1 be like a total that sometimes won't match the stacked children thus the bar will appear from behind like in the docs

  1. Changing the value of barWidth to anything more than 100
  2. Changing the value of barGap to anything less than 100

Will fix this problem which is how I fixed it for now, I made all the series bars a bit smaller to have a barGap that works, but the main reason I wanted to report this is that adding a third bar on any of the 3 series fixes the problem too

See this example

@MatthiasMert
Copy link

MatthiasMert commented Apr 29, 2024

There seem to be multiple problems with bar series.

The issue in the given example seems to be axis type: 'time' together with barWidth: '100%' but only at exactly 2 datapoints: Demo

Another issue seems to be that axis type: 'value' does not work at all with stack. The documentation is somewaht confusing on which axis types should work: Demo

For axis type: 'time' without the use of barWidth: '100%' its working fine: Demo

Axis type: 'category is working as intended. Note, that the order of the series matters: Demo

@GeorgeSedhom0
Copy link
Author

More on that the BarWidth seems to have some "reversed" behavior when there are only 2 values on a series
90% width on 2 values
90% width on 3 values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

3 participants