Skip to content

feat: support timezone on time scale charts#21475

Open
freshollie wants to merge 1 commit intoapache:masterfrom
field-energy:ob/timezone
Open

feat: support timezone on time scale charts#21475
freshollie wants to merge 1 commit intoapache:masterfrom
field-energy:ob/timezone

Conversation

@freshollie
Copy link

@freshollie freshollie commented Jan 14, 2026

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Supports formatting time axis with specific timezone. Very likely that this PR won't be merged since we are adding a new lib @date-fns/tz however, I believe the authors should consider. Provided here incase others want to use :)

Fixed issues

Details

Before: What was the problem?

Timezone on the time scale charts were only possible to set with UTC or device local time. It wasn't possible to change this format outside the library because the axis tick intervals were lost. Doing this within the lib is very simple and the change is non breaking (unless you count the new lib as breaking)

After: How does it behave after the fixing?

image Axis ticks work as expected when zooming in (even over DST changes) image

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

N.A.

Merging options

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

Other information

@echarts-bot
Copy link

echarts-bot bot commented Jan 14, 2026

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.

⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.

@freshollie freshollie marked this pull request as ready for review February 11, 2026 09:55
@echarts-bot
Copy link

echarts-bot bot commented Mar 9, 2026

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.

@echarts-bot echarts-bot bot added the PR: awaiting doc Document changes is required for this PR. label Mar 9, 2026
Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are extremely cautious when it comes to introducing external libraries. Do you think there's a way to implement this feature without bringing in additional libraries? For instance, could we provide something like timezoneOffset (you can research how other software name similar elements).

Also, please introduce the newly added interfaces in the description of your Pull Request. Thanks!

@freshollie
Copy link
Author

Hi @Ovilia I’m happy to document the interface changes if you believe this is something you’d want in.

Regarding the lib, @date-fns/tz is an extremely thin wrapper around the browser Intl.DateTimeFormat so in theory we could remove the lib by copying in the required source?

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.

3 participants