feat: the value axis range should be designed to accommodate marker
Brief Information
This pull request is in the type of:
- [ ] bug fixing
- [x] new feature
- [ ] others
fix issue
Fixes #21203
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 set the includeMarkerInExtent of the axis to true, the default axis range will 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.
After: How does it behave after the fixing?
When the user set the includeMarkerInExtent of the axis to true, the axis range will take into account the marker value
Document Info
One of the following should be checked.
- [ ] This PR doesn't relate to document changes
- [ ] The document should be updated later
- [x] 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
- [x] Please squash the commits into a single one when merging.
Other information
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.
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, 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.
@100pah Could you help me review this pull request?
@Ovilia Could you help push this PR forward? I think it would be beneficial in some scenarios
@100pah Could you help me review this pull request?
@Ovilia @100pah Could you help push this PR forward?
@Ovilia @100pah Could you help review this PR?