apache / apache/echarts

[Bug] MarkLine does not render

Open
#21,060 5 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.6.0

### Link to Minimal Reproduction

https://jsfiddle.net/pL8u97sz/4/

### Steps to Reproduce

1. call `setOption` with series without markLine
2. call `setOption` again but spread the previous options and adds series with the markLine

```
chart.setOption({
xAxis: {
type: "value",
},
yAxis: {
type: "value"
},
series: [{
data: [[10,10],[20,20],[30,15],[40,10],[50,20],[60,15],],
type: "line",
}]
});

chart.setOption({
...chart.getOption(),
series: [{
data: [[10,10],[20,20],[30,15],[40,10],[50,20],[60,15],],
type: "line",
markLine: {
data: [{ xAxis: 15 }, { xAxis: 25},]
},
}]
});
```

### Current Behavior

The chart is rendered without the marklines

![Image](https://github.com/user-attachments/assets/e20a1637-f352-4cd1-956c-2eeee3df221c)

### Expected Behavior

The chart is rendered with the marklines

![Image](https://github.com/user-attachments/assets/1aa7f608-194b-4809-ab9a-bb580928acb9)

### Environment

```markdown
- OS: linux
- Browser: firefox 139.0.4
- Framework: react@18
```

### Any additional comments?

Note that in my use case, I am using react.
I am updating the chart from different events.
Each does a `React.useEffect` where they call `setOption` and spread the previous option.

When I inspect the option from `getOption`, it has the desired configuration for the chart. Thus, I expect it render the markline

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.