Skip to content

Commit

Permalink
Add margin pusher for axes after the axes and label is layout
Browse files Browse the repository at this point in the history
  • Loading branch information
hy9be committed Apr 18, 2017
1 parent 6255f6d commit 5f5ad4f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,20 @@ Plotly.plot = function(gd, data, layout, config) {
return Plotly.Axes.doTicks(gd, 'redraw');
}

function marginPusherForAxes() {
var bbox = gd._fullLayout.xaxis._boundingBox;

Plots.autoMargin(gd, 'xaxis', {
x: 1,
y: 0,
l: 0,
r: bbox.width,
b: bbox.height,
t: 0
});
Plots.doAutoMargin(gd);
}

// Now plot the data
function drawData() {
var calcdata = gd.calcdata,
Expand Down Expand Up @@ -361,6 +375,7 @@ Plotly.plot = function(gd, data, layout, config) {
positionAndAutorange,
subroutines.layoutStyles,
drawAxes,
marginPusherForAxes,
drawData,
finalDraw,
Plots.rehover
Expand Down

0 comments on commit 5f5ad4f

Please sign in to comment.