hustcc / echarts-for-react

⛳️ Apache ECharts components for React wrapper. 一个简单的 Apache echarts 的 React 封装。
https://git.hust.cc/echarts-for-react
MIT License
4.56k stars 633 forks source link

echarts events 'finished' 触发多次 #315

Closed shuai4983958 closed 4 years ago

shuai4983958 commented 5 years ago

renderDifficultyRatio = () => { const onEvents = { finished: this.onChartFinished, }; return ( <ReactEcharts option={this.getDifficultyRatioOption()} theme="Imooc" onEvents={onEvents} style={{ height: '350px' }} /> ); };

shuai4983958 commented 5 years ago

onChartFinished = () => { alert('finish') // this.props.onPieFinished(); };

2-3次alert

howel52 commented 4 years ago

see: https://github.com/hustcc/echarts-for-react/blob/b1df3b339bf07d4f6a2b8fdc62ed3bc4c93f2d0d/src/core.jsx#L25-L34