Skip to content

fix(axis): respect custom axis tick interval. close #17967#21671

Open
rahul37wallst-sudo wants to merge 1 commit into
apache:masterfrom
rahul37wallst-sudo:investigate-17967-axis-tick-interval
Open

fix(axis): respect custom axis tick interval. close #17967#21671
rahul37wallst-sudo wants to merge 1 commit into
apache:masterfrom
rahul37wallst-sudo:investigate-17967-axis-tick-interval

Conversation

@rahul37wallst-sudo

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fix category axis ticks so axisTick.interval callback results are respected exactly.

Fixed issues

Details

Before: What was the problem?

When xAxis.axisTick.interval was a callback on a category axis, ECharts still kept extent-boundary ticks internally.

That caused two incorrect cases:

  • if the callback matched only one category, an extra tick appeared before the first bar;
  • if the callback matched multiple categories, an extra tick appeared after the last bar.

After: How does it behave after the fixing?

Function-based axisTick.interval now keeps ticks strictly according to the callback result.

The min/max boundary preservation remains for axis labels, where the existing label display strategy needs it, but custom axis tick callbacks no longer receive forced boundary ticks.

Validation:

npx jest --config test/ut/jest.config.cjs --coverage=false --runInBand --runTestsByPath test/ut/spec/scale/interval.test.ts
npm run checktype
npm run lint
git --no-pager diff --check

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

Added regression coverage in test/ut/spec/scale/interval.test.ts.

Merging options

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

Other information

N.A.

@echarts-bot

echarts-bot Bot commented Jul 2, 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.

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