Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f252f5

Browse files
committed
consider some offset from top of the bounding box when hiding a horizontal label
1 parent 445eee4 commit 5f252f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plots/cartesian/axes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,7 +3043,7 @@ axes.drawLabels = function(gd, ax, opts) {
30433043

30443044
var isX = ax._id.charAt(0) === 'x';
30453045

3046-
tickLabels.each(function() {
3046+
tickLabels.each(function(d) {
30473047
var thisLabel = d3.select(this);
30483048
var mathjaxGroup = thisLabel.select('.text-math-group');
30493049

@@ -3055,7 +3055,7 @@ axes.drawLabels = function(gd, ax, opts) {
30553055
else if(bb.left < min) hide = true;
30563056
} else {
30573057
if(bb.bottom > max) hide = true;
3058-
else if(bb.top < min) hide = true;
3058+
else if(bb.top + (ax.tickangle ? 0 : d.fontSize / 4) < min) hide = true;
30593059
}
30603060
if(hide) thisLabel.select('text').style({ opacity: 0 });
30613061
} // TODO: hide mathjax?

0 commit comments

Comments
 (0)