Skip to content

feat(line): restart smoothing at a marked vertex - #21797

Open
awtaylor wants to merge 3 commits into
apache:masterfrom
awtaylor:fix-21796
Open

awtaylor wants to merge 3 commits into
apache:masterfrom
awtaylor:fix-21796

Conversation

@awtaylor

@awtaylor awtaylor commented Oct 19, 2026 •

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Add an opt-in per-datum smoothing seam so a line stays connected but smoothing restarts at that vertex.

Fixed issues

Details

Before: What was the problem?

smooth: true uses samples on both sides of a vertex when it places control points. A series that is one legend entry and one axis tooltip cannot keep a real join, such as history against a forecast, from being rounded through. Splitting the series in two splits the legend and the tooltip.

null with connectNulls: false already lifts the pen. markLine only annotates. This is a corner, not a gap.

before
Not this... (gaps) gap

After: How does it behave after the fixing?

{ value: 80, smoothBreak: true } keeps the vertex on the stroke and restarts smoothing there. Each side is smoothed as if that vertex were the end of the piece. The default series is unchanged.

The flag is read only from a series.data object. Numbers, [x, y] tuples, and dataset rows cannot carry it. step ignores it, because stepping rebuilds the point list. A seam on a sample that sampling drops disappears with that sample. The stacked area seams the top edge of this series only, not the baseline from another series. During an update, the flag stays on the morphed vertex and uses the target datum for the whole animation.

smoothMonotone: 'x' and 'y' already use an axis-aligned tangent at every sample, so a seam often does not change those modes. The visual case uses smooth: true.

after

Document Info

One of the following should be checked.

  • 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

  • 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/line-smooth-break.html
  • test/ut/spec/chart/line/smoothBreak.test.ts

Merging options

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

Other information

The name smoothBreak is open to change. It is not a gap.

@echarts-bot echarts-bot Bot added PR: awaiting doc Document changes is required for this PR. PR: awaiting review labels Oct 19, 2026
@echarts-bot

echarts-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

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.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: awaiting doc Document changes is required for this PR. PR: awaiting review size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant