apache / apache/echarts

[Bug] Zoom (Panning) outside last data in series

Open
#20,219 4 comments 1 reaction 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.1

### Steps to Reproduce

I want to shift the data on the axis beyond the date. After the shift, get new data and redraw the data on the graph. See ER.

I tried to do this using the current capabilities and attaching the configuration below.
If you set a large percentage, it starts to work in a similar way. But it is unrealistic to select a percentage for the gap between the data every time
Also, this solution allows you to shift the axis only in one direction, and not in two at once.

Example:
```
option = {
xAxis: {
type: 'time',
splitNumber: 5,
},
dataZoom: {
start: 99.9992, // !!!
type: "inside",
moveOnMouseMove: "ctrl",
// rangeMode: [1570627800000, 50]
},
yAxis: {
type: 'value',
splitNumber: 3,
min: 0,
max: 5,
alignWithLabel: true
},
series: [
{
data: [[1721906700000, 0], [1721906400000, 1], [1721906100000, 2], [1721905800000, 0], [1721905500000, 1]],
type: 'line',
zoom: 0.15, // !!!
},
{
type: 'scatter',
data: [
[1570627800000, 2]
]
}
]
}
```

### Current Behavior

I can't achieve this behavior at the moment. rangeMode allows you to change the axis only inside the current segment 0-100.
Behavior with the configuration above: ![2](https://github.com/user-attachments/assets/0082ea7f-79bd-4dcb-9553-62a770b22727)

### Expected Behavior

ER:

The highcharts library allows you to do this: ![1](https://github.com/user-attachments/assets/4a6730c8-8b04-49e2-87ea-76a5aed1692d)

simplified example: https://jsfiddle.net/BlackLabel/uab5mw0d/

### Environment

```markdown
- OS: windows
- Browser: Chrome 126.0.6478.185
- Framework: React 18
```

### Any additional comments?

Is it possible to achieve ER with current capabilities?

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.