We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Flutter chart keep on flickering but only one range(0)

I am facing the same issue, but with me the issue is one chart is working absolutely fine and other chart only one range which is 0(y axis), keeps on flickering... if i do not use set state my widgets will not be build and i cannot see it updating when i call _updateDataSource. I have no idea why would it behave differently. Could anyone please help me on this?


4 Replies 1 reply marked as answer

AK Ankita Kumari March 7, 2023 08:40 AM UTC

I am facing the same issue (https://www.syncfusion.com/forums/169314/blinking-chart-when-refreshing-screen ), but with me the issue is one chart is working absolutely fine and other chart only one range which is 0(y axis), keeps on flickering... if i do not use set state my widgets will not be build and i cannot see it updating when i call _updateDataSource. I have no idea why would it behave differently. Could anyone please help me on this?


I even tried it keeping on inside initsState(), but if i keep my timer my widgets does not get updated i need to something so i should see the points are getting updated.



YG Yuvaraj Gajaraj Syncfusion Team March 8, 2023 01:46 PM UTC

Hi Ankita,


We have reviewed your query and would like to inform you that when you call setState in your application, the entire chart widget is updated and reinitialized. This is why we proposed using the updateDataSource method to update the chart data without rebuilding the entire chart. Therefore, we recommend avoiding calling setState in your application, as there is no other option to prevent the chart from flickering. We have shared the KB article below for your reference.


KB, https://www.syncfusion.com/kb/12316/


Regards,

Yuvaraj.


Marked as answer

AK Ankita Kumari March 13, 2023 04:31 AM UTC

Thanks for the reply. But i still am doing it with setState, as when i try using updatedDataSource, the user Interface does not get updated properly. I need to keep on doing Maximize or Minimize.



YG Yuvaraj Gajaraj Syncfusion Team March 13, 2023 03:06 PM UTC

Hi Ankita,


As mentioned earlier, when you call the setState method in your application, it will trigger a rebuild of the entire chart widget and all of its properties will be updated.

 

If you are facing an issue with updatedDataSource, please share more details with the chart code snippet and replication procedure, so that it will help us assist you in a better way. 


Regards,

Yuvaraj.



Loader.
Up arrow icon