Skip to content

feat(axis): add showMinLine / showMaxLine option for splitLine - #20114

Merged
Ovilia merged 1 commit into
apache:masterfrom
adaelixir:feature-#20110
Jul 18, 2024
Merged

Ovilia merged 1 commit into
apache:masterfrom
adaelixir:feature-#20110

Conversation

@adaelixir

@adaelixir adaelixir commented Jul 4, 2024 •

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

添加"删除坐标轴指定刻度上的分隔线"的功能
Add feature showMinLine showMaxLine to splitline 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?

用户可以将 showMinLine 或 showMaxLine 设置为 false,从而删除第一条或最后一条分割线
User can set the showMinLine/ showMaxLine be false to delete the first/last split line.

xAxis: {
  type: 'category',
  data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  splitLine: {
    show: true,
    showMinLine: false,  // do not show the first splitLine
    showMaxLine: false,  // do not show the last splitLine
    lineStyle: { color: 'black', width:3 }
},
image

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.

Misc

ZRender Changes

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

Related test cases or examples to use the new APIs

test/axis-splitLine.html

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 4, 2024
@echarts-bot

echarts-bot Bot commented Jul 4, 2024

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.

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.

@adaelixir adaelixir changed the title feature(axis): add feature showMin/MaxLine to splitline feature(axis): add showMin/MaxLine to splitline in coordinate axis Jul 4, 2024
@github-actions

Copy link
Copy Markdown
Contributor

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

@Ovilia
Ovilia merged commit 8e968f4 into apache:master Jul 18, 2024
@echarts-bot

echarts-bot Bot commented Jul 18, 2024

Copy link
Copy Markdown

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@Ovilia Ovilia added this to the 5.5.2 milestone Jul 18, 2024
@plainheart plainheart changed the title feature(axis): add showMin/MaxLine to splitline in coordinate axis feat(axis): add showMinLine / showMaxLine option for splitLine Jul 18, 2024
@echarts-bot echarts-bot Bot added PR: doc ready and removed PR: awaiting doc Document changes is required for this PR. labels Jul 23, 2024
@dberardo-com

Copy link
Copy Markdown

min/max labels on time axis show milliseconds:

image

is it possible to avoid this somehow?

@adaelixir

adaelixir commented May 6, 2025 via email

Copy link
Copy Markdown
Author

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.

split line from xAxis overlapped axisLine from yAxis [Feature] xAxis splitLine showMinLine showMaxLine

3 participants