Open shiguo2021 opened 4 years ago
放弃了,没有解决。
2020年8月28日 上午11:23,Glorycsc notifications@github.com 写道:
楼主解决了吗,碰到相同问题
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shifeng1993/react-native-secharts/issues/76#issuecomment-682303633, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5MPSRZ2CNNV446VPXY3ETSC4PL3ANCNFSM4P6FMI6A.
我在华为手机上也遇到类似问题,我的粗暴解决办法是在组件componentDidMount这个生命周期中对图表reload一下。
import React, {Component} from 'react';
import {Echarts} from 'react-native-secharts';
class Secharts extends Component {
constructor(props) {
super(props);
this.echartRef = React.createRef();
}
componentDidMount() {
this.echartRef.current.chartRef.current.reload();
}
render() {
return (
<Echarts
ref={this.echartRef}
option={this.props.chartOption}
height={120}
/>
);
}
}
export default Secharts;
楼主解决了吗,碰到相同问题