You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/05/15 02:05:39 UTC

[GitHub] [incubator-echarts] Yukimio opened a new issue #10467: 不同浏览器 react 下仪表盘刷新

Yukimio opened a new issue #10467: 不同浏览器 react 下仪表盘刷新
URL: https://github.com/apache/incubator-echarts/issues/10467
 
 
   在react中使用echarts时,使用props传入options刷新仪表盘,谷歌浏览器下指针不会变动,火狐浏览器会变动
   
   ```
   initChart = () => {
       const { value=11 } = this.props; //外部传入的data数据
       let myChart = echarts.init(this.refs.eChart); //初始化echarts
       if(this.eChart==null){
         this.eChart=myChart
       }
       options.series[0].data[0].value = value;
       this.eChart.setOption(options, true);
       myChart.resize();
   
       //图层点击事件
       let that = this;
       myChart.on('click',function (data){
         if(that.props.onClick){
             that.props.onClick(data);
         }
       });
     };
   componentDidMount() {
       this.initChart();
       if (this.refs) {
         EleResize.on(this.refs.eChart, this.listener);
       }
     }
     componentDidUpdate() {
       this.initChart();
     }
   ```
   
   ![image](https://user-images.githubusercontent.com/28559406/57743749-ee179280-76f8-11e9-9622-1a3a0cf17bb8.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org