apache / apache/echarts

[Bug] Datazoom bar in time chart does not accurately reflect chart if data is distributed evenly across time

Open
#20,374 6 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.2.2

### Link to Minimal Reproduction

https://jsfiddle.net/zecv4mhy/

### Steps to Reproduce

1. Create a time chart that uses DataZoom.
2. Use time series data that does not have equal size steps between each data point.

### Current Behavior

Currently the datazoom bar view is scaled to the points, meaning that the 50th% point is in the middle of the bar, however this is not how the chart itself functions, there the 50th% point in terms of time is in the middle of the chart. Selecting a part of the chart already works as expected, e.g. 90%-100% means that the last 10% of time is shown.

![image](https://github.com/user-attachments/assets/1e9cbf33-355a-409e-b548-e6aa7179e2b2)

### Expected Behavior

The data zoom shows the correct line corresponding to the graph (like the basic example below.)
![image](https://github.com/user-attachments/assets/ffbe61c8-a758-4fe4-ad4a-b4a0626eb247)

### Environment

```markdown
- OS:Linux
- Browser: Chrome
- 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.