echarts icon indicating copy to clipboard operation
echarts copied to clipboard

fix: Markline causes type error when used with series.encode

Open mikkurogue opened this issue 2 months ago • 2 comments

Brief Information

This pull request is in the type of:

  • [x] bug fixing
  • [ ] new feature
  • [ ] others

What does this PR do?

Fixes a type error that causes ordinalMeta to be undefined when used on encoded axes with series.encode.

Fixed issues

Details

Before: What was the problem?

When defining a markline within a series that uses the series.encode option, a type error would be thrown that ordinalMeta is undefined. It seems like due to this axis encoding, the series can not figure out the correct dimension to use for a markline. I feel its the same for markarea too.

After: How does it behave after the fixing?

In the initial case reported in issue #21300 I used the broken example as input and created a test html file to render the chart, and I noticed the marklines appearing again without needing to use a workaround of an empty/invisible scatter series.

Document Info

One of the following should be checked.

  • [x] This PR doesn't relate to document changes
  • [ ] The document should be updated later
  • [ ] The document changes have been made in apache/echarts-doc#xxx

Misc

Security Checking

  • [x] This PR uses security-sensitive Web APIs.

ZRender Changes

  • [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

test/markLine-dataset-encode-fix.html test/ut/spec/component/marker.test.ts

Merging options

  • [x] Please squash the commits into a single one when merging.

Other information

If anything needs to be changed or updated, please let me know. This is a bug affecting my workplace too so I felt I'd follow the ffmpeg motto of "Talk is cheap, send patches".

Thanks.

mikkurogue avatar Nov 03 '25 07:11 mikkurogue

Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

echarts-bot[bot] avatar Nov 03 '25 07:11 echarts-bot[bot]

This affect our usage of EChart so this fix is very much appreciated :pray: .

maeln avatar Nov 13 '25 14:11 maeln