Skip to content

Commit bca793e

Browse files
committed
fix(grid) Simplify default rotation computation of y-axis. close #9265
1 parent e90526c commit bca793e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/coord/axisHelper.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,7 @@ export function computeNameBoundingRect(axis: Axis2D): BoundingRect {
352352
}
353353
const axisLabelModel = axisModel.getModel('nameTextStyle');
354354
const unRotatedNameBoundingRect = axisLabelModel.getTextRect(axisModel.getModel('name').option);
355-
const defaultRotationYAxis = (axisModel.get('nameLocation') === 'end' || axisModel.get('nameLocation') === 'start')
356-
&& !axis.isHorizontal() ? 0 : -90;
357-
const defaultRotation = axis.dim === 'x' ? 0 : defaultRotationYAxis;
355+
const defaultRotation = axis.isHorizontal() ? 0 : -90;
358356
const rotatedNameBoundingRect = rotateTextRect(
359357
unRotatedNameBoundingRect, axisModel.getModel('nameRotate').option ?? defaultRotation
360358
);

0 commit comments

Comments
 (0)