in packages/charts/src/chart_types/xy_chart/annotations/rect/dimensions.ts [277:308]
function getXOutsideAnnotationDimensions(
panelSize: Size,
rotation: Rotation,
axisPosition: Position,
thickness: number,
): Pick<Rect, 'y' | 'height'> {
const { height, width } = panelSize;
switch (axisPosition) {
case Position.Top:
return {
y: rotation === 180 ? height : rotation === 90 ? width : -thickness,
height: thickness,
};
case Position.Bottom:
return {
y: rotation === 0 ? height : rotation === 90 ? width : -thickness,
height: thickness,
};
case Position.Left:
return {
y: rotation === -90 ? -thickness : width,
height: thickness,
};
case Position.Right:
default:
return {
y: rotation === -90 ? width : -thickness,
height: thickness,
};
}
}