diff --git a/js/parts/Chart.js b/js/parts/Chart.js index 296a0c5995f..70c50cc6398 100644 --- a/js/parts/Chart.js +++ b/js/parts/Chart.js @@ -1134,6 +1134,10 @@ extend(Chart.prototype, /** @lends Highcharts.Chart.prototype */ { chartWidth = chart.chartWidth; chartHeight = chart.chartHeight; + // Allow table cells and flex-boxes to shrink without the chart blocking + // them out (#6427) + css(renderTo, { overflow: 'hidden' }); + // Create the inner container /*= if (build.classic) { =*/ containerStyle = extend({ diff --git a/js/parts/Utilities.js b/js/parts/Utilities.js index fb160c74c60..2fc7e8a4cff 100644 --- a/js/parts/Utilities.js +++ b/js/parts/Utilities.js @@ -2009,9 +2009,17 @@ H.getStyle = function (el, prop, toInt) { if (prop === 'width') { return Math.max( 0, // #8377 - Math.min(el.offsetWidth, el.scrollWidth) - + ( + Math.min( + el.offsetWidth, + el.scrollWidth, + el.getBoundingClientRect ? + Math.floor(el.getBoundingClientRect().width) : // #6427 + Infinity + ) - H.getStyle(el, 'padding-left') - H.getStyle(el, 'padding-right') + ) ); } else if (prop === 'height') { return Math.max(