konzen opened a new pull request, #21739: URL: https://github.com/apache/echarts/pull/21739
## Brief Information This pull request is in the type of: - [ ] bug fixing - [x] new feature - [ ] others ### What does this PR do? Adds global and per-time-axis IANA time-zone support for ticks, labels, tooltips, and time utilities while preserving `useUTC` compatibility. ### Fixed issues - #14453: Support specifying a time zone for time axes. ## Details ### Before: What was the problem? Time axes could only use UTC or the browser/operating-system time zone. Charts could not select an IANA time zone or use different time zones for different axes. ### After: How does it behave after the fixing? Charts can define a global `timeZone`, overridden by `timeZone` on individual time axes. Time-axis ticks, labels, and tooltip values use the effective axis time zone. The legacy `useUTC` option remains supported, and `timeZone` takes precedence when both are specified. Input parsing behavior is unchanged. The implementation uses native `Intl.DateTimeFormat`, without external dependencies or a bundled time-zone database. <img width="1800" height="458" alt="dst-gap" src="https://github.com/user-attachments/assets/814e8c28-43c7-43b1-accf-2125cc42c173" /> <img width="1800" height="458" alt="dst-overlap" src="https://github.com/user-attachments/assets/e05d536d-9992-4fbe-aeee-2bd74e8b17be" /> <img width="1800" height="512" alt="tooltip-xy-timezones" src="https://github.com/user-attachments/assets/20a876e2-9426-4fdd-9219-ffb2e2a5dec7" /> ## Document Info - [ ] This PR doesn't relate to document changes - [ ] The document should be updated later - [x] The document changes have been made in apache/echarts-doc#529 ## Misc ### Security Checking - [ ] This PR uses security-sensitive Web APIs. ### ZRender Changes - [ ] This PR depends on ZRender changes. ### Related test cases or examples to use the new APIs - `test/ut/spec/scale/time.test.ts` - `test/ut/spec/util/time.test.ts` - `test/ut/spec/util/format.test.ts` - `test/ut/spec/component/tooltip/timeZone.test.ts` Validation: - `npm test` - `npm run checktype` - `npm run lint` - `npm run test:dts:fast` ### Merging options - [ ] Please squash the commits into a single one when merging. ### Other information This PR builds on the work started in #21475, continuing it with a native `Intl.DateTimeFormat` implementation and completing global and per-axis time-zone support, backward compatibility, DST handling, tooltips, tests, and documentation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
