diff --git a/src/components/react_canvas/axis.tsx b/src/components/react_canvas/axis.tsx index b7ba20f6a1..6b17f10723 100644 --- a/src/components/react_canvas/axis.tsx +++ b/src/components/react_canvas/axis.tsx @@ -177,7 +177,7 @@ export class Axis extends React.PureComponent { return null; } if (isHorizontal(position)) { - return this.renderOriziontalAxisTitle(); + return this.renderHorizontalAxisTitle(); } return this.renderVerticalAxisTitle(); } @@ -229,13 +229,13 @@ export class Axis extends React.PureComponent { ); } - private renderOriziontalAxisTitle() { + private renderHorizontalAxisTitle() { const { axisPosition: { width, height }, axisSpec: { title, position, tickSize, tickPadding }, axisTicksDimensions: { maxLabelBboxHeight }, chartTheme: { - axes: { titleFontSize }, + axes: { titleFontSize, titlePadding }, }, debug, } = this.props; @@ -244,7 +244,10 @@ export class Axis extends React.PureComponent { return; } - const top = position === Position.Top ? -maxLabelBboxHeight : maxLabelBboxHeight + tickPadding + tickSize; + const top = position === Position.Top ? + -maxLabelBboxHeight - titlePadding : + maxLabelBboxHeight + tickPadding + tickSize + titlePadding; + const left = 0; return (