From 1cada5c99619fc01610d8b9e8167421b7a792060 Mon Sep 17 00:00:00 2001 From: wibetter <365533093@qq.com> Date: Wed, 9 Aug 2023 18:08:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(amis-ui):=20chart=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=89=94=E9=99=A4=E9=BB=98=E8=AE=A4=E6=9C=80=E5=B0=8F=E5=AE=BD?= =?UTF-8?q?=E9=AB=98=E6=A0=B7=E5=BC=8F=E9=99=90=E5=88=B6=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=89=B9=E5=B0=8F=E5=AE=BD=E9=AB=98=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-ui/scss/components/_chart.scss | 2 -- packages/amis/src/renderers/Chart.tsx | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/amis-ui/scss/components/_chart.scss b/packages/amis-ui/scss/components/_chart.scss index 6f8c8cdc6..09db1f986 100644 --- a/packages/amis-ui/scss/components/_chart.scss +++ b/packages/amis-ui/scss/components/_chart.scss @@ -1,6 +1,4 @@ .#{$ns}Chart { - min-width: 300px; - min-height: 300px; position: relative; &-placeholder { diff --git a/packages/amis/src/renderers/Chart.tsx b/packages/amis/src/renderers/Chart.tsx index d59af8d88..033dbd3a2 100644 --- a/packages/amis/src/renderers/Chart.tsx +++ b/packages/amis/src/renderers/Chart.tsx @@ -596,9 +596,8 @@ export class Chart extends React.Component { data } = this.props; let style = this.props.style || {}; - - width && (style.width = width); - height && (style.height = height); + style.width = style.width || width || '300px'; + style.height = style.width || height || '300px'; const styleVar = buildStyle(style, data); return ( From 547de6f846ae446fa93d26ea07b041e94f311766 Mon Sep 17 00:00:00 2001 From: wibetter <365533093@qq.com> Date: Thu, 10 Aug 2023 09:52:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(amis):=20chart=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E6=94=B9=E7=94=A8100%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Chart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amis/src/renderers/Chart.tsx b/packages/amis/src/renderers/Chart.tsx index 033dbd3a2..cd8a4a305 100644 --- a/packages/amis/src/renderers/Chart.tsx +++ b/packages/amis/src/renderers/Chart.tsx @@ -596,7 +596,7 @@ export class Chart extends React.Component { data } = this.props; let style = this.props.style || {}; - style.width = style.width || width || '300px'; + style.width = style.width || width || '100%'; style.height = style.width || height || '300px'; const styleVar = buildStyle(style, data);