Skip to content

relayout not working in certain cases #1009

Closed
@fresheneesz

Description

@fresheneesz

I have this code that fails to relayout the width and height when an annotation is present:

http://codepen.io/anon/pen/RGxagY?editors=102

<head>
  <script src="https://cdn.plot.ly/plotly-1.0.0.min.js"></script>
</head>
<body>
  <div id="graph"></div>
</body>
<script>
var x = document.createElement('div')

var layout = {annotations: [
    {text:'My Annotation', arrowcolor: 'orange', font:{color:'orange'},
     x:2, y: 2
    }
  ]
}

Plotly.newPlot(x, [{x: [1,2,3],y: [1,2,3],type: 'scatter'}], layout)

document.body.appendChild(x)

layout.width = 100
layout.height = 100

Plotly.relayout(x,layout)
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions