question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chart height increases whenever the windows is resized when we use `height: '100%'`

See original GitHub issue

Bug report

Codepen

Here is the codepen.

Explanation

When we have height: '100%', whenever the window is resized the chart height increases. You can see this in the codepen above by simply restoring down/maximizing the browser or by resizing the window. In my own app, the height keeps on increasing forever after the first resize, I couldn’t repro this in the codepen. Here’s a gif of the problem from my app:

jIqe4xsfgl

I know that there’s this in the docs:

Note: If you provide a percentage value '100%', make sure to have a fixed height parent.

But isn’t using flex like that supposed to work? There’s no way I can give an explicit height to the parent, this just isn’t feasible when doing flexible layouts.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
BlvckParrotcommented, Aug 9, 2022

Hello, I still have this issue. I have parent container set to fixed height of 40vh and charts height set to 100% and It is still growing in size. The property min-height is still there and is probably causing the problem. I am using version 3.35.0.

0reactions
junedchhipacommented, Nov 21, 2020

Sure, I have fixed it by removing minHeight to container when the height is ‘100%’.

In case, there is not enough padding at the bottom of the chart, you will have to manually add some padding. This will be the only caveat when using height: 100%

Read more comments on GitHub >

github_iconTop Results From Across the Web

Height of the div is not proper when resizing the window
Then to let the div grow with the window height, use height: 100% or whatever percentage of the window height you need the...
Read more >
DIV tags with 100% relative height not resized - Microsoft Learn
The DIV tag stays at the initial absolute height of the table and will not be resized automatically.
Read more >
WebGL Resizing the Canvas.
Here's what you need to know to change the size of the canvas. Every canvas has 2 sizes. The size of its drawingbuffer....
Read more >
Changing the Size and Type | FusionCharts
When the container size changes, the chart is automatically resized accordingly. Set Width and Height in Pixels#. To set the width and height...
Read more >
Charts aren't full-size until page is refreshed - CanvasJS.com
I 'm using some charts in a 3dcart-hosted site. ... Whenever the window size changes the chart checks to see if the parent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found