apache / apache/echarts

[Bug] Unexpected behaviour with axis min/max and grid lines/labels

Open
#17,630 4 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.3.3

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?code=PYBwLglsB2AEC8sDeAoWsDGwA2wBOAXLANoBEAxAMyUCcAHACIBCpAugDRqxjA6QhFU6dGDwQA5uICmhWKQCGADwgBnUp2GwlqgArAI0MDMFdNYAJ4gpRUioAW8gCbAA7qVOwAvl08bY4sUdBXy5FAEFlFSJiIWELKxsMeSNxfHN1D0dk-WjSAFkYdTkAFQBXKSLSAHUpR0riu1LKgDExSoBlZI7S6DYfDi5zCNVo2JFLazkAN3lscozNAyM8GewiAFYABj90AFslIgAWACZt2AB6c9hDze2PbRUAGXkAIyk15A90e1c8pWe3h9ROULlcAGazFRSDzedCeAbfGQQKRREhjWDQeS7SakQAvboBS40A_dGAO9SFnEJjYXvI8GT0FS8FUII4wHYbAA2TYAUlpsCyYByJAAjGd1sd2LBTmdqIdxbQpZQzsdTqx-ihPEA&_source=echarts-doc-preview

### Steps to Reproduce

See link to reproduction - use **yAxis.max=**_420_ and **yAxis.axisLabel.showMaxValue=**_true_ to see the line issue, and _400/false_ for the label issue.

### Current Behavior

When using a static min/max on an axis, a grid line will be drawn for that value, even if it is not aligned to the grid. Similarly, showMin-/-MaxLabel will also affect the labels if they are aligned to the grid. I think both behaviours are unexpected from a user point of view.

### Expected Behavior

- **No** grid line should be drawn for min/max values when they are not aligned to the grid
- showMinLabel/showMaxLabel should **not** affect the labels at min/max if they are aligned to the grid (or, put the other way round: grid labels should **not** be affected by showMinLabel/showMaxLabel)

### Environment

```markdown
- OS: Windows 10
- Browser: Firefox
- Framework:
```

### Any additional comments?

_No response_

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.