Make layout height & width understand viewport and percentage sizes
See original GitHub issueHi, how can I set the width of the svg chart according to viewport width? I tried using width: '80vw'
in layout, but plotly doesn’t seem to parse the vw
units. Appreciate any help!
const layout = {
hovermode: 'closest',
autosize: true,
// width: 1000,
// height: 600,
margin: {
l: 50,
r: 20,
b: 50,
t: 50,
pad: 10
},
yaxis: {
rangemode: 'tozero'
}
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:11
- Comments:24 (10 by maintainers)
Top Results From Across the Web
CSS Viewport Units: A Quick Start - SitePoint
Viewport Height (vh). This unit is based on the height of the viewport. · Viewport Width (vw). This unit is based on the...
Read more >Viewport concepts - CSS: Cascading Style Sheets | MDN
The width property controls the size of the viewport. It should preferably be set to device-width , which is the width of the...
Read more >How to Understand Viewport Units in CSS - Perficient Blogs
Viewport units let you size items and fonts as a proportion of the user's screen's total width or height (the viewport).
Read more >How Big Is That Box? Understanding Sizing In CSS Layout
A grid track sized using a percentage will calculate the percentage from the grid container width. You can also use percentages for the...
Read more >Fun with Viewport Units | CSS-Tricks
Viewport Minimum ( vmin ) – A percentage of the viewport width or height, whichever is smaller. 10vmin will resolve to 10% of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
also broken for me. any pointers how to make graphs be 100% of their parent container?
This is still an issue. Height of figures is 450px unless you set it explicitly using px or vh/vw. Spent an extraordinarily long time banging my head against the wall on this one.