Pre loader

question on FIFO data series

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
0
0

Lets assume we plot a moving signal window with a non-FIFO data series. Then, the dataseries can be updated in a loop with the fixed-length buffer (YArray) containing the latest signal samples :

using (sciChart.SuspendUpdates())
        {
        SignalDataSeries.Clear();
        SignalDataSeries.Append(XArray, YArray);
        }

My question is whether the FIFO dataseries can be used to simplify the above code into

SignalDataSeries.Append(XArray, YArray);

given that we still use the same fixed-length YArray and FifoCapacity is set to its length? Are there any drawbacks in it, save for the doubling memory for the internal FIFO buffer?

Version
6.2.1
  • You must to post comments
Best Answer
0
0

Hi there,

If XArray, YArray length equals the DataSeries.FifoCapacity then you can indeed shorten the entire statement to just

 SignalDataSeries.Append(XArray, YArray);

In this case the entire fifo buffer will be replaced with the new arrays and no need to clear.

Give it a try! Let me know if this works

Best regards,
Andrew

  • corvex
    It worked. Thanks, Andrew! Btw, is SuspendUpdates() is called internally in such scenario?
  • Kenneth Machado
    Hi there, internally whenever you call .Append() or any function on DataSeries is performs a lock around a synchronisation object. SuspendUpdates() is used to freeze drawing on the chart if you do multiple operations at once, such as changing data, properties on RenderableSeries etc… The above method should be thread safe if that is what you want to know
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.