Skip to content

Conversation

@linlang171
Copy link

@linlang171 linlang171 commented Oct 14, 2025

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

When markers such as marker line, marker pointer, and marker area exceed the default axis range, they will be discarded directly. When the user does not specify the axis range, the default axis range should take into account the marker value

Details

Before: What was the problem?

{
             title: {
                text: '主标题',
                subtext: '副标题',
                left: 'center',
                top: 'top',
                textAlign: 'center',
                textVerticalAlign: 'top'
            },
            xAxis: {
                type: 'category',
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
            },
            yAxis: {
                type: 'value'
            },
             series: [{
                    data: [150, 230, 224, 218, 135, 147, 260],
                    type: 'line',
                    markLine: {
                        data: [
                            {
                                name: '两个屏幕坐标之间的标线',
                                yAxis: 467,
                                lineStyle: { color: 'red' }
                            }
                        ]
                    }
            }]
}

When markers such as marker line, marker pointer, and marker area exceed the default axis range, they will be discarded directly.

image

After: How does it behave after the fixing?

When the user does not specify the axis range, the default axis range should take into account the marker value

image

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#481

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
Copy link

echarts-bot bot commented Oct 14, 2025

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.

@linlang171 linlang171 changed the title fix The value axis range should be designed to accommodate marker fix the value axis range should be designed to accommodate marker Oct 14, 2025
@linlang171 linlang171 changed the title fix the value axis range should be designed to accommodate marker fix: the value axis range should be designed to accommodate marker Oct 14, 2025
@linlang171 linlang171 changed the title fix: the value axis range should be designed to accommodate marker feat: the value axis range should be designed to accommodate marker Oct 15, 2025
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 we should probably introduce a new option for this behavior.

@echarts-bot echarts-bot bot added PR: awaiting doc Document changes is required for this PR. and removed PR: doc unchanged labels Oct 15, 2025
@echarts-bot
Copy link

echarts-bot bot commented Oct 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.

@linlang171
Copy link
Author

I think we should probably introduce a new option for this behavior.

I have added a new configuration item, includeMarkerInExtent, in the axis configuration to control whether marker labels are considered when calculating the default axis range. Could you please review if this is reasonable? Thank you very much

@linlang171 linlang171 requested a review from Ovilia October 15, 2025 09:32
@helgasoft
Copy link

@linlang171, I appreciate you letting me know about this PR.
It would definitely help fix #21203. I agree that all marks (lines, points, areas) are an integral part of their series and should be visible by default. If the user wants to "hide" some of them, he could set axis range with min/max.

@Ovilia Ovilia requested a review from 100pah October 16, 2025 06:30
@linlang171
Copy link
Author

linlang171 commented Oct 20, 2025

@100pah Could you help me review 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.

3 participants