[Feature] Configurable priority level for displaying X axis labels
Open
new-feature
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### What problem does this feature solve?
In some charts, certain labels, e.g the start of the year or month should be prioritized to show over others.
### What does the proposed API look like?
`xAxis.axisLabel.interval` : `(index:number, value: string) => number`
The higher the number, the higher the priority to show over lower priority ones when `hideOverlap: true`.
e.g.
```ts
const options = {
xAxis: {
type: "category",
interval: (index, value) => {
if (firstDayOfYear(value)) {
return 2
}
if (firstDayOfMonth(value)) {
return 1
}
return 0
},
}
...
}
```
Contributor guide
Assessment
This issue has not been assessed yet.