Skip to content

fix(marker): use raw value without precision rounding when the mark line targets a specific axis value or is in min/max type - #21752

Open
plainheart wants to merge 2 commits into
releasefrom
fix/markLine-precision
Open

fix(marker): use raw value without precision rounding when the mark line targets a specific axis value or is in min/max type#21752
plainheart wants to merge 2 commits into
releasefrom
fix/markLine-precision

Conversation

@plainheart

@plainheart plainheart commented Sep 12, 2026

Copy link
Copy Markdown
Member

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

[Behavior Change]

  1. Fix the mark line is not at the expected position due to precision rounding when it targets a specific axis value.
  2. The mark line in min / max type is now also using the raw value without precision conversion.

For example:

{
  yAxis: 2.0156
}

Since precision defaults to 2, the mark line above is rounded to 2.02. So it appears in an unexpected position and even disappears when yAxis.min is 2.015.

Fixed issues

Fixes #21743

Comparison

Before After
Before After

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

test/markLine-precision.html

Merging options

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

Other information

…ult precision when it targets axis value to ensure it is at the expected position
@echarts-bot

echarts-bot Bot commented Sep 12, 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.

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

@plainheart
plainheart requested review from 100pah and a balanced review from Copilot September 12, 2026 03:02
@plainheart plainheart added this to the 6.1.1 milestone Sep 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Values requiring more than 20 decimal places are still rounded incorrectly.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes mark-line positioning when explicit axis values exceed the default precision.

Changes:

  • Derives precision from explicit axis values.
  • Adds a browser regression case.
File summaries
File Description
src/component/marker/MarkLineView.ts Adjusts mark-line coordinate rounding.
test/markLine-precision.html Demonstrates explicit-value precision behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/component/marker/MarkLineView.ts Outdated
…ine targets a specific axis value or is in `min/max` type
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Sep 12, 2026
@plainheart plainheart changed the title fix(marker): fix mark line is not at the expected position due to default precision when it targets a specific axis value fix(marker): use raw value without precision rounding when the mark line targets a specific axis value or is in min/max type Sep 12, 2026
@plainheart
plainheart requested a balanced review from Copilot September 12, 2026 03:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused implementation matches the intended semantics and includes appropriate regression coverage.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@plainheart plainheart linked an issue Sep 12, 2026 that may be closed by this pull request
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.

[Bug] markLine设置的y值例如2.015标注在了2.019上方

2 participants