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

feature(axis): add hiddenTicks to remove SplitLine on specified tick #20110

Closed
wants to merge 1 commit into from
Closed

feature(axis): add hiddenTicks to remove SplitLine on specified tick #20110

wants to merge 1 commit into from

Conversation

adaelixir
Copy link
Contributor

@adaelixir adaelixir commented Jul 3, 2024

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

添加"删除坐标轴指定刻度上的分隔线"的功能
Add feature to remove SplitLine on specified tick in coordinate axis

Fixed issues

Details

Before: What was the problem?

用户无法自定义删除任意刻度上的分割线
当 xAxis 选项中的 splitline 属性与 yAxis 选项中的 axisLine 属性同时设置时,两条线会在 yAxis 轴线所在的位置重叠
User cannot customize the deletion of dividing lines on any scale.
While splitline attr in xAxis options and axisLine atrr in yAxis options set concurrently, two lines from each other overlapper in the position where yAxis axisline lies.

After: How does it behave after the fixing?

用户可以在 hiddenTicks 数组中添加要删除的刻度索引,从而删除对应的分割线
User can add the tick index to be deleted in the hiddenTicks array to delete the corresponding dividing line.

xAxis: {
  type: 'category',
  data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  splitLine: {
    show: true,
    hiddenTicks: [0,1,2,5,7],
    lineStyle: { color: 'black', width:3 }
},
截屏2024-07-03 16 55 23

Note

在调试代码的过程中发现ticksCoords数组中没有给刻度线右侧的点设置tickValue,这会影响在后续查询隐藏线条的绘制,所以修改了 Axis.ts 的getTicksCoords方法
While debugging the code, I found that the ticksCoords array did not set tickValue for the points on the left and right sides of the tick mark, which would affect the drawing of hidden lines in subsequent queries, so I modified the getTicksCoords method of Axis.ts
截屏2024-07-03 16 49 15

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

N.A.

Others

Merging options

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

Other information

@echarts-bot echarts-bot bot added PR: awaiting doc Document changes is required for this PR. PR: awaiting review labels Jul 3, 2024
Copy link

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

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 unchanged PR: awaiting doc Document changes is required for this PR. and removed PR: awaiting doc Document changes is required for this PR. PR: doc unchanged labels Jul 3, 2024
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.

It may be a better idea to provide splitLine.showMin(Max)Line, just as axisLabel.showMin(Max)Label, unless it's proven necessary to have the ability to control whether to show each of the split lines.

@adaelixir adaelixir changed the title feature(axis): add feature to remove SplitLine on specified tick feature(axis): add hiddenTicks to remove SplitLine on specified tick Jul 4, 2024
@plainheart
Copy link
Member

Superseded by #20114

@plainheart plainheart closed this Jul 18, 2024
@plainheart plainheart removed the PR: awaiting doc Document changes is required for this PR. label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants