Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: axis with break #19459

Open
wants to merge 42 commits into
base: v6
Choose a base branch
from
Open

feat: axis with break #19459

wants to merge 42 commits into from

Conversation

Ovilia
Copy link
Contributor

@Ovilia Ovilia commented Jan 2, 2024

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

image

Provide a way to make break axes that may range too wide.

This is also helpful for expressing the lunch break (11:30-13:00) on intraday stock trading charts.

image

This PR also changes indicesOfNearest from DataStore to Series so that when in axisPointer, we can compare the data in the view coordinate rather ran data value, so that the nearest data is more intuitive since it's nearer to the mouse position.

Fixed issues

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

ZRender Changes

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

Related test cases or examples to use the new APIs

When doing visual tests agains v6 branches, there are 4 diffs:

  • axis-break: This is the new test file for this feature so it's expected to be different
  • tooltip-axisPointer-snap: This is the new test file for indicesOfNearest and it checks if axisPointer snaps to the nearest data in view coord instead of data value so it's expected to be different
  • area-large: Due to the change of indicesOfNearest, it's now always get the nearest data. But before, some position may don't show tooltip (probably due to large data filtering). So it's expected to be different.
  • pie-label-extreme: After adding the logic to hiding label elements with zero width and height, the pie labelLines with no label text (due to truncation) will not be displayed. This is a more reasonable presentation because it seems to be not expected to show labelLine when there is not label displayed.

截屏2025-01-15 17 19 24

See the full test report:

report.html.zip

Others

Merging options

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

Other information

Copy link

echarts-bot bot commented Jan 2, 2024

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.

The pull request is marked to be PR: author is committer because you are a committer of this project.

⚠️ 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.

@Ovilia
Copy link
Contributor Author

Ovilia commented Jan 2, 2024

Discussion: Should this feature be called "axis breaking" or "axis collapsing"? This may probably depend on if I can implement break folding/unfolding feature.

I think the HighCharts implementation is quite tricky for the users. Although we can provide similar APIs with graphic.elements to enable developers do similar things, I'd prefer implementing such design as default axis broken style so that it won't be misleading to viewers if developers aren't very experienced in dataviz and don't know how to (or why should) let viewers understand this is an axis skipped some ranges.

Copy link
Contributor

github-actions bot commented Jan 2, 2024

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19459@85c56b9

@pull-request-size pull-request-size bot added size/XL and removed size/L labels Jan 4, 2024
@Ovilia Ovilia added this to the 6.0.0 milestone Jan 31, 2024
@Ovilia Ovilia changed the base branch from next to v6 August 13, 2024 06:46
@Ovilia Ovilia changed the base branch from v6 to next August 14, 2024 02:34
@Ovilia Ovilia changed the base branch from next to v6 October 29, 2024 06:53
Copy link

echarts-bot bot commented Jan 15, 2025

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 Jan 15, 2025
@Ovilia Ovilia marked this pull request as ready for review January 17, 2025 07:34
@Ovilia Ovilia changed the title feat(WIP): axis with break feat: axis with break Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Almost Done
Development

Successfully merging this pull request may close these issues.

2 participants