Skip to content

Commit 5f5ad4f

Browse files
committed
Add margin pusher for axes after the axes and label is layout
1 parent 6255f6d commit 5f5ad4f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/plot_api/plot_api.js

+15
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,20 @@ Plotly.plot = function(gd, data, layout, config) {
279279
return Plotly.Axes.doTicks(gd, 'redraw');
280280
}
281281

282+
function marginPusherForAxes() {
283+
var bbox = gd._fullLayout.xaxis._boundingBox;
284+
285+
Plots.autoMargin(gd, 'xaxis', {
286+
x: 1,
287+
y: 0,
288+
l: 0,
289+
r: bbox.width,
290+
b: bbox.height,
291+
t: 0
292+
});
293+
Plots.doAutoMargin(gd);
294+
}
295+
282296
// Now plot the data
283297
function drawData() {
284298
var calcdata = gd.calcdata,
@@ -361,6 +375,7 @@ Plotly.plot = function(gd, data, layout, config) {
361375
positionAndAutorange,
362376
subroutines.layoutStyles,
363377
drawAxes,
378+
marginPusherForAxes,
364379
drawData,
365380
finalDraw,
366381
Plots.rehover

0 commit comments

Comments
 (0)