Page 1 of 1
High-speed plotting using Teechart for UWP
Posted: Fri Apr 01, 2016 6:05 pm
by 16075226
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?
Re: High-speed plotting using Teechart for UWP
Posted: Mon Apr 04, 2016 10:19 am
by Christopher
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 (49.83 KiB) Viewed 7484 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.
Re: High-speed plotting using Teechart for UWP
Posted: Thu Apr 07, 2016 7:34 pm
by 16075226
Dear Christopher,
Thanks for this,
I was rather afraid it was the case