diff --git a/src/core.tsx b/src/core.tsx index 432627e..a00a233 100644 --- a/src/core.tsx +++ b/src/core.tsx @@ -209,7 +209,16 @@ export default class EChartsReactCore extends PureComponent { echartsInstance.resize({ width: 'auto', height: 'auto', - }); + + // 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); } diff --git a/src/types.ts b/src/types.ts index 5e6119f..3301c4d 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?: object; }; export type EChartsReactProps = {