shifeng1993 / react-native-secharts

一个webview封装的图表组件。基于百度echarts4
MIT License
219 stars 57 forks source link

在小米手机上显示有随机性,有时显示,有时不显示 #76

Open shiguo2021 opened 4 years ago

Glorycsc commented 4 years ago

楼主解决了吗,碰到相同问题

shiguo2021 commented 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.

wuchaoliang commented 3 years ago

我在华为手机上也遇到类似问题,我的粗暴解决办法是在组件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;