Skip to content

fix(timeline): apply progress and emphasis label formatter - #21795

Open
Thanatos9404 wants to merge 1 commit into
apache:releasefrom
Thanatos9404:fix-18673
Open

Thanatos9404 wants to merge 1 commit into
apache:releasefrom
Thanatos9404:fix-18673

Conversation

@Thanatos9404

@Thanatos9404 Thanatos9404 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?

Makes the slider timeline use progress.label.formatter and emphasis.label.formatter for the label text in those states.

Fixed issues

Details

Before: What was the problem?

Both formatters are documented but had no effect. SliderTimelineView._renderAxisLabel only took the text from label.formatter, and the progress and emphasis states only got a text style, so a label in progress could change color but kept its normal text.

After: How does it behave after the fixing?

When progress.label or emphasis.label has a formatter (for progress.label, also on a data item), that state's text goes through the same makeLabelFormatter path as label.formatter. makeLabelFormatter gets an optional label model argument; existing callers are unchanged. States without a formatter keep the normal text.

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/ut/spec/component/timeline/label.test.ts: six of its seven cases fail on release and all pass with this change. There is also a new case at the bottom of test/timeline-case.html.

Merging options

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

Other information

On a time or value axis the progress state is checked against the tick value instead of the data index, so it may not switch on there. That is a separate bug (it looks like #19137) and isn't changed here.

…che#18673

`timeline.progress.label.formatter` and `timeline.emphasis.label.formatter`
are documented, but the slider timeline only took the text style from
those label models, so the label text never changed in those states.

Format the text of each state with its own formatter in the same way as
`label.formatter`, with the same arguments, and keep the normal text when
a state has no formatter.
@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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant