apache / apache/echarts

Overlapping labels in xAxis with type="time"

Open
#19,980 2 comments 2 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.0

### Link to Minimal Reproduction

https://jsfiddle.net/qm84x016/1/

### Steps to Reproduce

The data and the code are provided above so the chart is created when running it. The plot looks like this:

![image](https://github.com/apache/echarts/assets/80517901/6170fe4d-e6db-4828-9267-9d48f97b2a7d)

### Current Behavior

The problem is that the x axis labels overlap and I have not found a way of solving this.

I have seen the parameter interval in the [documentation](https://echarts.apache.org/en/option.html#xAxis.interval), but I think it cannot be used with type='time' in the xAxis. If I try to add it in the code I get the following error in VS Code (but not on the URL provided):

```
Object literal may only specify known properties, and 'interval' does not exist in type 'AxisLabelBaseOption | AxisLabelOption<"time">'.ts(2353)
```

### Expected Behavior

I want to get a chart where labels do NOT overlap. It would be great if I could add a label per month of data (i.e., 1st May, 1st June...).

### Environment

```markdown
- OS: macOS Big Sur
- Browser: Chrome 124.0.6367.208
- Framework: Ionic 7.2.0 + Angular
```

### Any additional comments?

Thank you!

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.