Bubble chart not refreshing after modifying the datasource

Hi,

I have a Bubble chart and I want to update the chart based on the filters that the user selected. I thought by just updating the datasource will also reflect the changes on the chart, but its not. I read here in this demo that you triggered a .refresh() method from loaded event. I tried to do the same but it doesn't work.

Is there some methods that I need to call explicitly to refresh the chart? Can someone point me in the right direction or give an example? 

Thanks for the help!

- Ed


3 Replies

BP Baby Palanidurai Syncfusion Team July 19, 2018 07:18 AM UTC

Hi Ed, 

Thanks for using Syncfusion products, 

  We have analyzed your query and as per your requirement we have prepared a sample. In that sample we have added two buttons, one is to start the live charts and another is to stop the dynamic update. In start button click, we have refresh data by calling the refresh method and the chart refreshed with new data in the set interval method. Sample for your reference can be find from below link, 
 
Please find the code snippet below to achieve this requirement, 

       <button onClick={this.start.bind(this)}>Start 
        </button> 
        <button onClick={this.stop.bind(this)}>Stop 
        </button> 

start() { 
    this.timerID = setInterval( 
      () => this.live(), 
      500 
    ); 
  } 
  stop() { 
    clearInterval(this.timerID); 
  } 
  live() { 

    if (this.value < 25) { 
      this.value += Math.random() * 2.0; 
    } else { 
      this.value -= 2.0; 
    } 
    this.series1.push({ x: this.i, y: this.value, size: Math.random() }); 
    this.i++; 
    this.series1.shift(); 
    this.chart.series[0].dataSource = this.series1; 
    this.chart.refresh(); 
  } 

If the issue is still persists from your side, kindly revert us by modify the above sample or provide your sample with replication steps which will be helpful in further analysis and provide you the solution sooner. 


Thanks, 
Baby. 



ED Ed July 24, 2018 04:59 PM UTC

Hi Baby,

Thanks for helping me on this. It is now working.

Regards,

Ed


BP Baby Palanidurai Syncfusion Team July 25, 2018 05:09 AM UTC

 Hi Ed,


Thanks for your update,


Please let us know if you need any further assistance on this.



Thanks,

Baby. 


Loader.
Up arrow icon