Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react 5.1 增加了resize动画的功能,echarts-for-react v3.0.2 应该如何调用? #551

Open
xwbxxx opened this issue Aug 17, 2023 · 1 comment

Comments

@xwbxxx
Copy link

xwbxxx commented Aug 17, 2023

如图所示,react 5.1新增了resize动画的功能image

这是我的代码,我应该如何在echarts-for-react v3.0.2中调用这个新功能?

import React from 'react';
import '../element/App.css';
import ReactEcharts from "echarts-for-react";

export default function EchartPanel() {
    const bar = () => {
        const option = {
            // echart option
        };
        return option;
    }
    return (<div className={'EchartPanel'}>
         <ReactEcharts option={bar()}/>
    </div>);
}
@fengluhome
Copy link

const chartInst: any = chartRef?.current?.getEchartsInstance(); chartInst.resize({ width : 300 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants