Skip to content

Commit

Permalink
[axis] fix label transform
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster committed Jun 9, 2017
1 parent a7fbf04 commit e8148b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vx-axis/src/utils/labelTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export default function labelTransform({

let x, y, transform = null;
if (orientation === ORIENT.top || orientation === ORIENT.bottom) {
x = range[1] / 2;
x = Math.max(...range) / 2;
y = sign * (tickLength + labelOffset + tickLabelFontSize +
(orientation === ORIENT.bottom ? fontSize : 0));
} else {
x = sign * (range[0] / 2);
x = sign * (Math.max(...range) / 2);
y = -(tickLength + labelOffset);
transform = `rotate(${sign * 90})`;
}
Expand Down

0 comments on commit e8148b7

Please sign in to comment.