High-speed plotting using Teechart for UWP

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

High-speed plotting using Teechart for UWP

Post by Anaesthesia » Fri Apr 01, 2016 6:05 pm

I need to plot an ECG waveform.

The signal is captured at 300 Hz in 1 second (300 value) records.

I want to display it using a refresh rate of 25 Hz (40 mSec), plotting 12 values on each cycle.

My X axis has a maximum value of 3000 (10 secs).

I'm using 'Fastline'.

My prototype starts well enough, but gets progressively slower as more points are added. - Even running on a high-end PC it takes over a minute to accumulate 3000 data points.

Is high-speed plotting possible in UWP?

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: High-speed plotting using Teechart for UWP

Post by Christopher » Mon Apr 04, 2016 10:19 am

Anaesthesia wrote: Is high-speed plotting possible in UWP?
I've just run a test with code such as this:

Code: Select all

    public MainPage()
    {
      this.InitializeComponent();
      CreateChart();
      InitializeChart();
    }


    TChart tChart1;
    DispatcherTimer timer = new DispatcherTimer();
    private void CreateChart()
    {
      Utils.CalcFramesPerSecond = true;
      tChart1 = new TChart();
      Grid1.Children.Add(tChart1);

      timer.Tick += Timer_Tick;
      timer.Interval = TimeSpan.FromMilliseconds(10);
    }

    private void Timer_Tick(object sender, object e)
    {
      tChart1[0].FillSampleValues();
      tChart1.Header.Text = Utils.FramesPerSecond.ToString();
    }

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      tChart1.Aspect.GestureOptions = Steema.TeeChart.Store.Drawing.Aspect.Gestures.None;
      Line line = new Line(tChart1.Chart);
      timer.Start();
    }
On this machine this gives me peak FPS of about 13, which compares to the FPS of about 64 using similar code under Windows Forms. Looking at the results of a performance profiling session suggests to me that the difference in speed is not due to TeeChart code but is due to the UWP framework itself, e.g.
perfsession.PNG
perfsession.PNG (49.83 KiB) Viewed 7509 times
I think therefore that TeeChart.UWP is not suitable for very high speed plotting. However, if you are happy with FPS of 10 then TeeChart.UWP can easily be used - when adding points to a series in realtime, please be aware that points will accumulate in it which will affect performance. As a countermeasure you can eliminate series points when the series count reaches a certain number.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: High-speed plotting using Teechart for UWP

Post by Anaesthesia » Thu Apr 07, 2016 7:34 pm

Dear Christopher,

Thanks for this,

I was rather afraid it was the case :(

Post Reply