Skip to content

Commit c5b79ea

Browse files
committed
provide padding for inside tick labels when not asked for
1 parent 9d48c6e commit c5b79ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/plots/cartesian/autorange.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,18 @@ function makePadFn(ax, max) {
221221
extrappad = adjustPadForInsideLabelsOnAnchorAxis(extrappad, ax, max);
222222
extrappad = adjustPadForInsideLabelsOnThisAxis(extrappad, ax, max);
223223

224+
var pad0 = 0;
225+
pad0 = adjustPadForInsideLabelsOnAnchorAxis(pad0, ax, max);
226+
pad0 = adjustPadForInsideLabelsOnThisAxis(pad0, ax, max);
227+
224228
// domain-constrained axes: base extrappad on the unconstrained
225229
// domain so it's consistent as the domain changes
226230
if((ax.constrain === 'domain') && ax._inputDomain) {
227231
extrappad *= (ax._inputDomain[1] - ax._inputDomain[0]) /
228232
(ax.domain[1] - ax.domain[0]);
229233
}
230234

231-
return function getPad(pt) { return pt.pad + (pt.extrapad ? extrappad : 0); };
235+
return function getPad(pt) { return pt.pad + (pt.extrapad ? extrappad : pad0); };
232236
}
233237

234238
var TEXTPAD = 3;

0 commit comments

Comments
 (0)