apache / apache/echarts

[Bug] Stacked Bar chart with value/number x-axis doesn't stack

Open
#20,355 1 comment 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.5.1

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=bar-negative&version=5.3.0&code=PYBwLglsB2AEC8sDeBYAULTsBEAPAgrhAM7YBcy6WW2AJgIZj3mwDaAjAEwC6VWAvgBo-mbAE9CJFkiEicxAKYAnCAtIVWc6qgzU9osGJAKW2AEb0l2Ybv3U6jZhq13qm2689cbn37ABs7C6-3D5-ocF62MRMAMYA1qbMYfqyHtqR9obGphZWKZ4OTCzufnqlZXbemX4AzAAcNfoR6XYtZdFxiRTYyZH8crxo_EA

### Steps to Reproduce

Create a chart with the following options with atleast echarts v5.3.0:

```json
{
"xAxis": {
"data": [12]
},
"yAxis": {},
"series": [
{
"type": "bar",
"data": [
[
12,
61
],
],
"stack": "a",
},
{
"type": "bar",
"data": [
[
12,
38
],
],
"stack": "a",
}
]
}
```

### Current Behavior

The Bars overlap and each series starts at 0.

![bar-negative (2)](https://github.com/user-attachments/assets/c1de10d9-276e-48f0-a913-da3db00c4bad)

### Expected Behavior

The Bars should be stacked.

![bar-negative (1)](https://github.com/user-attachments/assets/f0074b70-1e75-480d-b862-dbc01949391c)

### Environment

```markdown
- OS: Windows 11
- Browser: Chrome 128.0.6613.138
- Framework:
```

### Any additional comments?

The Bug exists since version 5.3.0.
It still worked with version 5.2.2.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.