Skip to content

Commit

Permalink
fix(core): correct axis title paddings in y-axes (#873)
Browse files Browse the repository at this point in the history
closes #859
  • Loading branch information
theiliad authored Nov 10, 2020
1 parent f692129 commit 8a27a5f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/core/src/components/axes/two-dimensional-axes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,19 @@ export class TwoDimensionalAxes extends Component {
if (child.getTitleRef().empty()) {
offset = 0;
} else {
offset = DOMUtils.getSVGElementSize(child.getTitleRef(), {
useBBox: true
}).height;
offset = DOMUtils.getSVGElementSize(
child.getTitleRef(),
{
useBBox: true
}
).height;

if (
axisPosition === AxisPositions.LEFT ||
axisPosition === AxisPositions.RIGHT
) {
offset += 5;
}
}

switch (axisPosition) {
Expand Down

0 comments on commit 8a27a5f

Please sign in to comment.