apache / apache/echarts

Is there a way to prevent the axis name from automatically overlapping with its labels?

Open
#17,902 3 comments 1 reaction 0 assignees View on GitHub
en enhancement
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

_No response_

### Steps to Reproduce

1. Go to [Heatmap on Cartesian](https://echarts.apache.org/examples/en/editor.html?c=heatmap-cartesian) chart example from project web page.
2. Add the following attributes to `yAxis` option: `name: 'Axis name'` and `nameLocation: 'center'`:
![yAxis attributes](https://user-images.githubusercontent.com/271477/201136774-ba804339-164a-40bf-b959-de2697375138.jpg)
3. Press `Run` button at top and check how `Axis name` overlaps few labels:
![overlapped value](https://user-images.githubusercontent.com/271477/201137419-41c47ae0-d135-4f67-ba1d-d2c8922b89b9.png)

### Current Behavior

Axis name overlaps its labels
![overlapped value](https://user-images.githubusercontent.com/271477/201137419-41c47ae0-d135-4f67-ba1d-d2c8922b89b9.png)

### Expected Behavior

Axis name should appear right next to values
![no overlapped](https://user-images.githubusercontent.com/271477/201138224-01e59045-bb85-4a3c-b51f-5fba80f78cd4.png)

### Environment

```markdown
- OS: Any
- Browser: Chrome or Firefox. Latest versions
```

### Any additional comments?

I know we can use `nameGap` attribute, but in some cases there is no way to know how long the label will be.
Is there a way to get the "size" of the label space/boundaries?

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.