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

Stack bar plot doesn't show correctly when under specific x axis range and with dataZoom given #20009

Open
YuanyeChi opened this issue Jun 6, 2024 · 2 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@YuanyeChi
Copy link

Version

5.5.0

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/proud-frost-jdgn8t?file=%2Fsrc%2Findex.js%3A17%2C13&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clx3jngyy00063b6k3i62ybf6%2522%252C%2522sizes%2522%253A%255B100%252C0%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clx3jngyy00023b6kekqyayx6%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clx3jngyy00033b6kyfou0mzo%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clx3jngyy00053b6kr2937cd9%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clx3jngyy00023b6kekqyayx6%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clx3jngyy00013b6kq0a75yoy%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Fsrc%252Findex.js%2522%252C%2522state%2522%253A%2522IDLE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A17%252C%2522startColumn%2522%253A13%252C%2522endLineNumber%2522%253A17%252C%2522endColumn%2522%253A13%257D%255D%257D%255D%252C%2522id%2522%253A%2522clx3jngyy00023b6kekqyayx6%2522%252C%2522activeTabId%2522%253A%2522clx3jngyy00013b6kq0a75yoy%2522%257D%252C%2522clx3jngyy00053b6kr2937cd9%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clx3jngyy00043b6km1pheoaq%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A0%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clx3jngyy00053b6kr2937cd9%2522%252C%2522activeTabId%2522%253A%2522clx3jngyy00043b6km1pheoaq%2522%257D%252C%2522clx3jngyy00033b6kyfou0mzo%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522clx3jngyy00033b6kyfou0mzo%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Afalse%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Steps to Reproduce

Open the codesandbox and you will see the abnormal behavior.

Current Behavior

image

Right two columns won't show second series' information(in green color). When I set the x axis range bigger like 0-10 or remove the range, the missing two green series come back.

Expected Behavior

image

All five column should have two stack bars because there is no 0 in given 2 series.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@YuanyeChi YuanyeChi added the bug label Jun 6, 2024
@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 Jun 6, 2024
@helgasoft
Copy link

API for stack says "Name of stack. On the same category axis".
Your xAxis type is 'value' (not 'category') and therefore bars are not stacked, and some are hidden by others and do not show up. Demo fix

@YuanyeChi
Copy link
Author

Thanks for giving the catetory type solution! My original intention is to use stack on value type axis, and the example I gave simplified. I found there are already several related issu: #15102 #16765 #7937.

My real application takes in dataset from scientific instrument whose x axis is in at least 4-digit decimal, so imputating the missing value might not be very ideal but is a great workaround.

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

2 participants