Simple Real Time Chart Plot (not MVVM)

Hello,
Is there any possibility to have a small application showing how to plot real time data on XY chart? I looked at the sample of patient monitoring but I hope it is possible to get unbound example (non MVVM based). Thanks

4 Replies

HM Hemalatha Marikumar Syncfusion Team May 18, 2020 06:19 AM UTC

Hi Waleed El-Badry, 
 
Greetings from Syncfusion. 
 
Is there any possibility to have a small application showing how to plot real time data on XY chart? 
 
Yes. It is possible to create a real time data on XY chart as per in below KB  
 
 
But your requirement is about without MVVM, hence modified the same sample without having MVVM pattern. Please download the same in below link 
 
 
Regards,
Hemalatha M. 



WE Waleed El-Badry May 19, 2020 02:39 PM UTC

Thank you Hemalatha for your response and the sample example
I tried to fit the example to my needs as I am working on multiple charts with 10ms update interval. I have two issues
  1. The chart starts to be heavy in update after few hundred points.
  2. The time range is not shifted (I tried to make it 5 sec before starts shifting but failed to do so). I try to keep 5 sec (500 points) window while shifting point by point.
I have attached my trial based on your code. I tried to attach it but always getting an error so I uploaded to secure Mega. Your assistance is highly appreciated.


Also, Would performance be hit if I added another 3 charts so all 4 charts are updated in 10 ms intervals?


RB Rodolphe Billottet May 20, 2020 10:38 AM UTC

Hi there,

I have also some need for Charting in real-time and I'm concerned about the performance as the SfChart is getting very slow with just few hundred of points.  

I'm actually currently using an old version of SfChart (v12.x) which was ok, till  30~50,000 points, so quiet not understanding sush degradation of performance.    



DD Devakumar Dhanapoosanam Syncfusion Team May 20, 2020 03:32 PM UTC

Hi Waleed El-Badry, 
 
Thanks for your update. 
 
We have analyzed your reported query and the provided sample, and we would like to let you know that for real time update with huge data point we can improve the chart performance by using the chart SuspendSeriesNotification and ResumeSeriesNotification while adding huge data as per in the below code snippet,  
 
XAML: 
<chart:SfChart.PrimaryAxis> 
       <chart:NumericalAxis Name="TimeAxis" Header="Time (s)" IsTabStop="False" 
                                     Minimum="0" MaximumLabels="5" 
                                     AutoScrollingDelta="4" AutoScrollingMode="End"/> 
</chart:SfChart.PrimaryAxis> 
<chart:SfChart.SecondaryAxis> 
                <chart:NumericalAxis Header="Voltage" /> 
</chart:SfChart.SecondaryAxis> 
 
 
 
C#: 
 
private void Timer_Tick(object sender, EventArgs e) 
{ 
      var ekg = RandEkg.Next(0, 33) / 10.0; 
      SfChart.SuspendSeriesNotification(); 
      Viewmodel.AddDataPoint(ekg, T, 500); 
      SfChart.ResumeSeriesNotification(); 
      T += 0.01; 
} 
 
 
 
 
 
Please let us know whether the above solution improve the chart performance while adding multiple series or not. 
 
Regards, 
Devakumar D 


Loader.
Up arrow icon