Skip to content

Commit 591b321

Browse files
committed
adjust padding for inside tick labels
1 parent 47c5773 commit 591b321

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

src/plots/cartesian/autorange.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,8 @@ function makePadFn(ax, max) {
247247
Math.max(h * cosA, w * sinA)
248248
);
249249

250-
var fontSize = anchorAxis.tickfont ? anchorAxis.tickfont.size : 12;
251250
// add extra pad around label
252-
morePad += fontSize / 5;
251+
morePad += 3;
253252
}
254253
});
255254
}

src/plots/cartesian/axes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2529,12 +2529,12 @@ function getTickLabelUV(ax) {
25292529
if(isAligned) {
25302530
u += fontSize * MID_SHIFT * (isX ? 0.25 : 2);
25312531
}
2532-
if(!isX) {
2533-
v += fontSize * MID_SHIFT;
2534-
} else if(side === 'bottom') {
2532+
if(!isX || side === 'bottom') {
25352533
v += fontSize * MID_SHIFT / 2;
2534+
v += 3; // add extra pad
25362535
}
25372536

2537+
25382538
if(isLeft || isTop) u = -u;
25392539
if(side === 'bottom' || side === 'right') v = -v;
25402540

-274 Bytes
Loading
-1.1 KB
Loading

0 commit comments

Comments
 (0)