apache / apache/echarts

[Bug] No markLine drawn if one of the markLines is empty

Open
#21,683 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

6.1

### Link to Minimal Reproduction

https://jsfiddle.net/Lvop3jc7/

### Steps to Reproduce

1. Add a series with markLine and then inside the data of the markLine have one empty object
` markLine: {
data: [
{
"yAxis": 1
},
{},
{
"yAxis": 3
},
]
}`

### Current Behavior

No markLine is rendered.
There is a error Uncaught TypeError: Cannot read properties of undefined (reading 'coord')

### Expected Behavior

The empty markLine is skipped in rendering, but the other marklines are rendered. No error.

### Environment

```markdown
- OS: Windows 11
- Browser: Chrome
- Framework:
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked JSFiddle reproduction and trace the markLine rendering path for the data array containing an empty object. Confirm that the empty entry is skipped while the yAxis 1 and yAxis 3 lines still render without the reported TypeError; add or update coverage if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.