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] =?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 (