apache / apache/echarts

[Bug] Y axis min value set to 0 with all the values below 0

Open
#20,908 2 comments 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.6.0

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqtALokAvn3Tkc-IqlJlKNWQDdGAGyW9-sALYRoRAAwatsPFQ4QqhWKNsDQ1ghMBF_AFoARgAmZx5YCLjnFXdDCmo6ACNGDlpbdRI1dQBuIA

### Steps to Reproduce

1. Create a bar chart with negative data
2. Set yAxis.min = 0 (or any positive value)
3. See that this is not respected
4. Change yAxis.min (for instance to -10)
5. Limit is respected

### Current Behavior

If I have a bar chart with all the values below 0 and I set the yAxis.min to 0 it is not respected.

### Expected Behavior

I would expect that the yAxis.min is always respected

### Environment

```markdown
- OS: Windows 10
- Browser: Chrome
- Framework: Web Components

- reproducible in the official editor
```

### Any additional comments?

Code to reproduce the issue:
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue']
},
yAxis: {
type: 'value',
min: 0 // change to -10 for instance and see that it works
},
series: [
{
data: [-120, -200],
type: 'bar'
}
]
};

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.