Dynamically resize iframe height without hard coding height

Is there a way to dynamically resize the iframe height of an embedded dashboard? I have used the iframe-resizer and it works well for resizing the width, but if the browser width becomes too small, then the iframe grows vertically (as expected) and a scroll bar pops up in the iframe. I would like to avoid scrolling in the iframe, but I haven’t found a good way to do this so far. Unless you set the min-height of the iframe higher, but then, when the page is wide, there is a lot of space between the bottom of the visuals and the footer.