From d73c391b9120e9872ab48b5c5ac90ef710cb5e3c Mon Sep 17 00:00:00 2001 From: xwbxxx <49603007+xwbxxx@users.noreply.github.com> Date: Tue, 22 Aug 2023 01:21:11 +0800 Subject: [PATCH 1/5] Update core.tsx --- src/core.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core.tsx b/src/core.tsx index 432627e..b3246a0 100644 --- a/src/core.tsx +++ b/src/core.tsx @@ -209,6 +209,8 @@ export default class EChartsReactCore extends PureComponent { echartsInstance.resize({ width: 'auto', height: 'auto', + //xwb edit + this.props.opt.resize, }); } catch (e) { console.warn(e); From 3c6e00703eb37a4005a7af4fd66ea427eed62c05 Mon Sep 17 00:00:00 2001 From: xwbxxx <49603007+xwbxxx@users.noreply.github.com> Date: Tue, 22 Aug 2023 02:58:13 +0800 Subject: [PATCH 2/5] Update core.tsx --- src/core.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core.tsx b/src/core.tsx index b3246a0..57eb856 100644 --- a/src/core.tsx +++ b/src/core.tsx @@ -209,9 +209,16 @@ export default class EChartsReactCore extends PureComponent { echartsInstance.resize({ width: 'auto', height: 'auto', - //xwb edit - this.props.opt.resize, - }); + + // follow echarts v5.1+: https://echarts.apache.org/zh/api.html#echartsInstance.resize + // resize:{ + // animation?: { + // duration?: number + // easing?: string + // } + // } + this.props.opts.resize + }); } catch (e) { console.warn(e); } From f66a0a033d7a979621c5e267de48af823c425a31 Mon Sep 17 00:00:00 2001 From: xwbxxx <49603007+xwbxxx@users.noreply.github.com> Date: Tue, 22 Aug 2023 02:59:36 +0800 Subject: [PATCH 3/5] Update core.tsx --- src/core.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.tsx b/src/core.tsx index 57eb856..a00a233 100644 --- a/src/core.tsx +++ b/src/core.tsx @@ -217,7 +217,7 @@ export default class EChartsReactCore extends PureComponent { // easing?: string // } // } - this.props.opts.resize + this.props.opts.resize, }); } catch (e) { console.warn(e); From ea46c59bf621d80eca83b72c68638632d99ecdb0 Mon Sep 17 00:00:00 2001 From: xwbxxx <49603007+xwbxxx@users.noreply.github.com> Date: Tue, 22 Aug 2023 03:02:40 +0800 Subject: [PATCH 4/5] Update types.ts --- src/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types.ts b/src/types.ts index 5e6119f..bbe1bc2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,6 +10,7 @@ export type Opts = { readonly width?: number | null | undefined | 'auto'; readonly height?: number | null | undefined | 'auto'; readonly locale?: string; + readonly resize?: objective; }; export type EChartsReactProps = { From ec8f5b479acbb9f8f6eed5355e78af1946f476cb Mon Sep 17 00:00:00 2001 From: xwbxxx <49603007+xwbxxx@users.noreply.github.com> Date: Tue, 22 Aug 2023 04:09:40 +0800 Subject: [PATCH 5/5] Update types.ts --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index bbe1bc2..3301c4d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,7 +10,7 @@ export type Opts = { readonly width?: number | null | undefined | 'auto'; readonly height?: number | null | undefined | 'auto'; readonly locale?: string; - readonly resize?: objective; + readonly resize?: object; }; export type EChartsReactProps = {