score:3

Accepted answer

Add margin to layout and specify the distance (in pixels) of the graph from the surrounding box.

var trace1 = {
x: ['2013-10-04 22:23:00', '2013-10-06 22:23:00',  '2013-11-04 22:23:00',       '2013-11-07 22:23:00','2013-12-04 22:23:00', '2013-12-08 22:23:00'],
y: [1, 3, 6,2, 4, 5],
fill: 'tozeroy',
type: 'scatter',
fillcolor: 'red'
};
var layout = {
  margin: {
    l: 20,
    r: 10,
    b: 40,
    t: 10
  },
};

var plotlyData = [trace1];                                      
Plotly.newPlot('heap_memory_graph', plotlyData, layout);
var plotDiv = document.getElementById('heap_memory_graph'); 
  
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

<div id="heap_memory_graph" style="width: 480px; height: 400px;"></div>


Related Query

More Query from same tag