Skip to content

fix(time): drop the extra tick past its span - #21783

Open
nextchamp-saqib wants to merge 1 commit into
apache:masterfrom
nextchamp-saqib:fix/time-axis-extra-tick
Open

nextchamp-saqib wants to merge 1 commit into
apache:masterfrom
nextchamp-saqib:fix/time-axis-extra-tick

Conversation

@nextchamp-saqib

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Stops a time axis from adding a stray day tick just after each month start.

Fixed issues

None filed.

Details

Before: What was the problem?

With about 120 days of daily data, the day level uses a 16-day interval. addTicksInSpan pushes one extra tick past each month span so the next level can be computed, but only drops it when it passes extent[1]. So June 17 + 16 = July 3 stays in the final ticks:

Jun 9, Jun 17, Jul 1, Jul 3, Jul 17, Aug 1, Aug 2, Aug 17, Sep 1, Sep 2, Sep 17, Oct 1, Oct 3, Oct 6

July 3 sits two days from July 1, so with hideOverlap the month label is often the one hidden and the axis reads 17 3 17 2 17 2.

After: How does it behave after the fixing?

The extra tick is also marked notAdd once it passes the span end (maxTimestamp). That end is a tick of the level above, so nothing is lost:

Jun 9, Jun 17, Jul 1, Jul 17, Aug 1, Aug 17, Sep 1, Sep 17, Oct 1, Oct 6

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/scale/time.test.ts

Merging options

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

Other information

@echarts-bot

echarts-bot Bot commented Oct 7, 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