Skip to content

Conversation

@aggarwal-h
Copy link

@aggarwal-h aggarwal-h commented Jun 17, 2023

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

This PR adds a triggerOnNull option to the axisPointer that enables the triggering of the axisPointer on null values when using the echarts.connect or dispatchAction API.

Fixed issues

None.

Details

Before: What was the problem?

Prior to this PR, when connecting multiple charts using echarts.connect with trigger set to axis, the axisPointer would not get triggered if the value in the connected chart was null.

An example of this can be seen in the image below (https://codesandbox.io/s/echarts-without-toggleonnull-fy4g4d?file=/src/index.js):
SCR-20230617-lhpv

After: How does it behave after the fixing?

After this PR, the user can set the option to trigger the axisPointer on null values using the triggerOnNull option, like below:

axisPointer: {
    triggerOnNull: true
}

This enables them to trigger the axisPointer on the connected charts even if those do not have a value, or their value is null or undefined.

Note: axisPointer's snap property takes precedence over this feature and should be set to false in the xAxis for this to work.

SCR-20230617-lovx

Document Info

One of the following should be checked.

Misc

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

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

Other information

The documentation has been updated in this PR: apache/echarts-doc#349

@echarts-bot
Copy link

echarts-bot bot commented Jun 17, 2023

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.

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 PR: doc ready and removed PR: awaiting doc Document changes is required for this PR. labels Jun 17, 2023
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.

I think this is a useful feature! Could we have more test cases, including snap cases? Please checkout https://github.com/apache/echarts/wiki/How-to-make-a-pull-request#test

@aggarwal-h
Copy link
Author

aggarwal-h commented Jun 20, 2023

Thanks for your feedback @Ovilia! I have added some test cases. Please let me know if anything else is required 🙂.

Screenshot3 2023-06-20 at 7 24 22 PM

@aggarwal-h aggarwal-h requested a review from Ovilia June 21, 2023 12:45
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2025

This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. We are sorry for this but 2 years is a long time and the code base has been changed a lot. Thanks for your contribution anyway.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label Aug 9, 2025
@github-actions
Copy link
Contributor

This PR has been automatically closed because it has not had recent activity. Sorry for that and we are looking forward to your next contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: doc ready PR: first-time contributor size/S stale Inactive for a long time. Will be closed in 7 days.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants