echarts
echarts copied to clipboard
fix: markArea of bar series now covers whole categories specified
Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
What does this PR do?
MarkArea in bar series/category axis now covers the categories specified rather than area between bars of specified categories.
Fixed issues
- fix #3573
- fix #17021
- fix #12341
Details
Before: What was the problem?
MarkArea in barSeries/category-axis is marking the area between bars of category specified, which is not wanted in category axis chart.
| #3573 | ![]() |
|---|---|
| #12341 | ![]() |
| -- | -- |
| #17021 | ![]() |
After: How is it fixed in this PR?
Now markArea marks the whole category zones specified. Multi-bars and invert input are both considered.
Left MarkArea
markArea: {
data: [
[
{
name: `Invert input`,
xAxis: 'Thu'
},
{
xAxis: 'Mon'
}
]
]
}
Left MarkArea
markArea: {
data: [
[
{
name: 'Single Emphasis',
xAxis: 'Sun'
},
{
xAxis: 'Sun'
}
]
]
}
Misc
- [ ] The API has been changed (apache/echarts-doc#xxx).
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
Related test cases or examples to use the new APIs
bar-markArea.html
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.
Any plans to merge this pr?
@dynamikus Thanks for your contribution and please be patient to wait for reviews since we are mostly working part-time on the project. :)
This PR looks awesome! I would like to see more test cases, for example, when xAxis and yAxis are both configured in the data, or x and y values.
@jiawulin001 Thank you for looking into this. Sorry if my questions sounded condescending or demanding that was never my attention. Keep up with the great work 👍
I would like to see more test cases
@Ovilia More test cases are on the way.
Sorry if my questions sounded condescending or demanding that was never my attention.
@dynamikus Thank you for your applause, and it's totally fine to ask. I am really glad if my work can help someone else.
@Ovilia A new test case in the same html is added
@jiawulin001 Thanks! Please also run the visual test for all cases and see if there are diffs that we should be aware of. You should compare local changes with the nightly build of master branch.
@Ovilia Thank you for guiding me to visual test. However since "Run all test" takes forever to run, I run the test relative to markArea and markLine and the result is as followed. The first test case is added by me, so it's expected to see differences there and no other test cases are affected.

Update 2022/6/13 11:28
Seems that there are issues of MarkPoint caused by changes, dealing with it.

Update 2022/6/13 11:39
Issue resolved, now most visual test passed. Let me know if I need to do other testcases.

Also it's very time consuming to run all visual tests. It takes 40+ minutes to execute all of them. Is there a way to solve or improve this?
@jiawulin001 Thanks for running the visual tests! I think you are working with the unexpected test results, right?
Also it's very time consuming to run all visual tests. It takes 40+ minutes to execute all of them. Is there a way to solve or improve this?
Usually, we only do a thorough test before releasing a new version or the PR changes a lot of logic or the reviewers are not very confident with the changes. For PRs like this, test the files that contain "mark" in their names should be enough. But a thorough test is always helpful so thanks for the effort and time! :)
I think you are working with the unexpected test results, right?
If you mean the issues of markPoint, it's been resolved in the update. No other issues occur.
Hi @jiawulin001, Thanks for your recent contributions! They help a lot! It would be better if you could check the reason why the configured husky hook and ESLint plugin don't work for you. It can give you on-time corresponding warnings and fixing strategies and reduce extra commits that fix lint issues after you make them work normally. :)
My apologies for those lint fix commits! I've been using github desktop to submit commits and the hooks seem not to work on it. I'll use my IDE to submit commits and make sure I execute lint scripts before them in the future. Thank you for your reminding!
I have another question regarding visual test. When I am doing all kinds of PR, is there a criterion how I pick what visual tests to do and how should I present the results to the community?
I have another question regarding visual test. When I am doing all kinds of PR, is there a criterion how I pick what visual tests to do and how should I present the results to the community?
If you want to export the report, there's a "ALL RUNS" button on the menu. Check the versions and time to know which running should be exported and click "report" to export.
Any update on this PR? Would help a lot as neither markArea or splitArea is working correctly today in bar charts with dataZoom :(
@Ovilia Hi, I think I've resolved the conflict in merging. Any other suggestions on how should I improve this PR? Or should we move forward to merging?
Hi, Is there any plan to merge the problem to the latest version in the near future? @Ovilia 🤔️
Hi, Is there any plan to merge the problem to the latest version in the near future? @Ovilia 🤔️
This PR is scheduled in 5.4.1, which should be published in November.
To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged
This message is shown because the PR description doesn't contain the document related template.
Congratulations! Your PR has been merged. Thanks for your contribution! 👍
It seems this PR breaks zoom functionality: https://github.com/apache/echarts/issues/18099
Since version 5.4.1 the markArea in my bar chart is broken, I think it's related to this PR
@ily-salamat Hi, thanks for your report! Please create a new issue and make a reference to this PR. We'll try to confirm and fix it in v5.5.0.
Also, thank you @andrius-kurtinaitis for filing a similar bug. I've marked your issue as high-priority and will fix it first.


