apache / apache/echarts

[Bug] Graph Line Distortion When Zooming: Unexpected Connections Between Remaining Points

Open
#20,572 2 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.5.1

### Link to Minimal Reproduction

-

### Steps to Reproduce

option = {
xAxis: {
type: 'category',
boundaryGap: false
},
yAxis: {
type: 'value',
boundaryGap: [0, '30%']
},
dataZoom: [
{
type: 'inside'
},
{
type: 'slider',
showDataShadow: false,
handleIcon:
'path://M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%'
},
{
type: 'inside',
orient: 'vertical'
},
{
type: 'slider',
orient: 'vertical',
showDataShadow: false,
handleIcon:
'path://M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%'
}
],
visualMap: {
type: 'piecewise',
show: false,
dimension: 0,
seriesIndex: 0,
pieces: [
{
gt: 1,
lt: 3,
color: 'rgba(0, 0, 180, 0.4)'
},
{
gt: 5,
lt: 7,
color: 'rgba(0, 0, 180, 0.4)'
}
]
},
series: [
{
type: 'line',
smooth: 0.6,
symbol: 'none',
lineStyle: {
color: '#5470C6',
width: 5
},
markLine: {
symbol: ['none', 'none'],
label: { show: false },
data: [{ xAxis: 1 }, { xAxis: 3 }, { xAxis: 5 }, { xAxis: 7 }]
},
areaStyle: {},
data: [
['2019-10-10', 200],
['2019-10-11', 560],
['2019-10-12', 750],
['2019-10-13', 580],
['2019-10-14', 250],
['2019-10-15', 300],
['2019-10-16', 450],
['2019-10-17', 300],
['2019-10-18', 100]
]
}
]
};

### Current Behavior

This is what the chat looks like after initialization:
![grafik](https://github.com/user-attachments/assets/cb0ec8fd-85b6-4cfe-a8df-50f9f5f0dbfc)

When zooming into the chart, the curve of the chart changes in a way that it no longer displays the desired shape or behavior:
![grafik](https://github.com/user-attachments/assets/14a03eee-1ff7-4ae7-9b52-61df810a37b4)

### Expected Behavior

The actual curve of the graph should remain approximately the same:
![grafik](https://github.com/user-attachments/assets/c73ef43c-1dae-4949-ac5f-7fba6a6f234e)

When zooming into the chart and some points end up outside the visible area, the remaining points are automatically reconnected, creating new connections. This, however, alters the curve of the graph. My expectation is that the graph's line should exit the chart at the x-axis (zero line) and re-enter later without changing the original curve.

### Environment

```markdown
- OS:
- Browser:
- Framework:
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the provided chart option against ECharts 5.5.1 and reproduce the line distortion while zooming. Compare the visible curve with the unzoomed chart and verify that points outside the viewport are not reconnected in a way that changes the original curve.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.