Plotly div does not take full available height


When getting the div of a plotly (python) chart with responsive set to True, and inserting it into an HTML file the chart takes the full width but not the full available height. The plotly div is placed into a parent div with width 100% and height 100%, and the plotly JS is included (tried both CDN version and JS as part of the DIV).

Is there anything else that needs to be done to achieve the same chart behaviour as when generating the HTML chart by plotly itself?


Hi @drex891mt,

That sounds like it should be enough. Here is the Python code for building the div:

Have you double checked that the figure doesn’t define it’s own height in fig.layout.height? If this were set to an explicit value, then responsive: true would not override it.



Hi @jmmease,

Thanks for your feedback. Yes checked that, there is no value for fig.layout.height (and fig.layout.width).