From 20aaf644fa6f580f55b17721815bdd917940e1da Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Tue, 14 Sep 2021 18:28:15 +0900 Subject: [PATCH] useMaxWidth should make height 100% too. --- src/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 96306f189..09520b9cb 100644 --- a/src/utils.js +++ b/src/utils.js @@ -778,12 +778,13 @@ const d3Attrs = function (d3Elem, attrs) { export const calculateSvgSizeAttrs = function (height, width, useMaxWidth) { let attrs = new Map(); - attrs.set('height', height); if (useMaxWidth) { attrs.set('width', '100%'); + attrs.set('height', '100%'); attrs.set('style', `max-width: ${width}px;`); } else { attrs.set('width', width); + attrs.set('height', height); } return attrs; };