the graph slows down when there is a lot of data

I have a graph of serial type, where the firestore data is captured, for the (X) axis the fecha element is taken and for the (Y) axis the faithful element is field1, this data arrives at a fire store every 1 hour and over time the data becomes less and less visible as the amount increases
¿Is there a way that when displaying the graph it does not display all the data, if it does not display the most recent, and when sliding towards the SfCartesianChart it shows me the oldest data?

3 Replies

DD Dharanidharan Dharmasivam Syncfusion Team April 6, 2020 09:34 AM UTC

Hi Aldair, 

Greetings from Syncfusion. We have analyzed your query, to view the recent data you can get the maximum value from your data source and assign it to the visibleMaximum property of the axis and depends on the data you need to view, you can assign visibleMinimum property of the axis. And with the panning option, you can view the old data. In the below code snippet, we have assigned 10 values lesser than the visibleMaximum, this can be changed based on your scenario. 

 
SfCartesianChart( 
            primaryXAxis: NumericAxis( 
              visibleMaximum: maximum, 
              visibleMinimum: maximum - 10 
            ) 
          ) 
 

If your query is misunderstood at our end, kindly provide more information on your requirements. This will help us to analyze further and provide you solution sooner. 

Thanks, 
Dharani. 



AR Aldair Ramiro Turizo Gamarra April 6, 2020 05:06 PM UTC

Hello, this solution does not work for me, since I am working with DateTimeAxis, could you please help me with my solution?



DD Dharanidharan Dharmasivam Syncfusion Team April 7, 2020 09:51 AM UTC

Hi Aldair, 
 
Thanks for the piece of knowledge. Since, you use the date-time axis and update your database once for one hour, we have changed the date-time axis code snippet based on the hours. You can change this based on your scenario. 
 
 
SfCartesianChart( 
          primaryXAxis: DateTimeAxis( 
            visibleMaximum: maximum, 
            visibleMinimum: maximum.subtract(Duration(hours: 2)) 
          ), 
          // Other configurations 
       ) 
 
 
The sample for reference can be found below. 
 
Thanks, 
Dharani. 


Loader.
Up arrow icon