The getter 'zoomFactor' was called on null

Hii,
I am working on area chart where large no of data points will be plotted on the view port. In this case I am using visibleMinimum and visibleMaximum properties for displaying limited data points according the requirements. When I enable the zoom and panning, It works. But at that time when I make hotReload(FLUTTER)  or setState for updating the state. It throws two errors such as
1. NoSuchMethodError: The getter 'zoomFactor' was called on null.
2. UnSupported operation: Infinity or NaN toInt

It runs without any error if I don't use visibleMinimum and visibleMaximum properties and  Zooming and Panning as well. If I make zoom in/out, then I am getting errors.

Please find the attachment.
Waiting for your response that will help me out from this error.
Thank you.

Attachment: codesamplewitherrors_2fb3da55.zip

1 Reply 1 reply marked as answer

SK Sriram Kiran Senthilkumar Syncfusion Team July 6, 2020 11:06 AM UTC

Hi Novneet, 
  
Greetings from Syncfusion. We have analyzed your scenario and from the shared code snippet, we found that the visible minimum and maximum values which were provided was incorrect according to the chart data source order. Due to this only, the panning or zooming on the chart throws some exceptions. However, we have modified the provided sample’s visibleMinimum and visibleMaximum values according to the chart’s data source and attached the sample below for your reference. After providing the correct values according to the chart’s data source for the visibleMinimum and visibleMaximum properties, there were no exceptions in the chart when zoomed or panned. 
  
  
Please check the attached test sample and revert us if you have further concerns. 
  
Regards, 
Sriram Kiran 


Marked as answer
Loader.
Up arrow icon