Version
5.5.0
Link to Minimal Reproduction
Steps to Reproduce
Open the minimal reproduction link and you should easily see the issue.
Current Behavior
The clip option for bar chart doesn't work as expected.
Expected Behavior
It should look like this when clip option is true.
Environment
The environment is irrelevant but here it is:
- OS: macOS Sonoma
- Browser: Chrome 125
Any additional comments?
The option was actually working as expected, but at some point it was broken, specifically by #11338 . The PR seems intentional. But there is no explanation on why it is done or any link to any existing issues. I assume author did it for a specific use-case, but they could have easily used clip: false
to achieve the same result.
Here are some related issues:
#17858
#12720
#13321
#11240
#10374
Fixed by PR #19973
4条答案
按热度按时间wnavrhmk1#
Thank you for working on this, @KurtGokhan.
I see two issues:
dataZoom:{type:'inside'}
= silent filterMode:'filter'I suppose you are fixing 1. Would the PR also remove outside bars when zoom filterMode is 'none' ?
Review of referenced issues:
#10374 : log scale vertical, no problem, maybe fixed?
#11240 : general discussion, closed
#12720 : about dataZoom.filterMode:'none' not clipping
#17858 : same as above
#13321 : on point - clipping parts of single bars
mwngjboj2#
The first 2 issues are "related" but don't exactly ask the same thing.
The other three issues don't also ask exactly the same thing, but are caused by the same problem. The problem is, bar chart doesn't clip correctly. I also noticed this problem initially with
dataZoom.filterMode:'none'
, but the problem also exists if the bar clips with the axis by other means, i.e. by usingmin/max
as in my example. My PR fixes both issues.Also added a test-case with dataZoom.
ffscu2ro3#
Just want to make sure
bar.clip:true
does not overridedataZoom.filterMode:'none'
.Seeing bars outside axis limits is not a bad option. It reminds forgetful people (like me) that there is an active zoom-in.
If they want to eliminate the outside bars, they'll set
dataZoom.filterMode:'filter'
.9avjhtql4#
Are you talking about a real use case, or a hypothetical one? In any case, you can use
clip:false
to see bars outside axis limits, like how it is intended.It doesn't look good though. The bars collide with the axes, making it unreadable.
Other chart types support
clip
already, although not perfectly. The bar chart is the most problematic one.