Skip to content

Commit

Permalink
fix issue 5301
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Nov 24, 2020
1 parent b5f09fb commit 6e80dc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,17 @@ axes.makeLabelFns = function(ax, shift, angle) {

x0 = labelStandoff;
y0 = labelShift * flipIt;
ff = Math.abs(ax.tickangle) === 90 ? 0.5 : 0;
ff = 0;
if(Math.abs(ax.tickangle) === 90) {
if(
(ax.tickangle === -90 && side === 'left') ||
(ax.tickangle === 90 && side === 'right')
) {
ff = CAP_SHIFT;
} else {
ff = 0.5;
}
}

out.xFn = function(d) { return d.dx + shift - (x0 + d.fontSize * ff) * flipIt; };
out.yFn = function(d) { return d.dy + y0 + d.fontSize * MID_SHIFT; };
Expand Down
Binary file modified test/image/baselines/bar_multiline_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e80dc9

Please sign in to comment.