Pre loader

Fifo capacity

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

0
0

I was used fifo(scrolling) chart in wpf scichart.

But.

I could not found fifo option in js scichart.

Maybe because there is no fifo option, if there is a lot of data accumulated, the chart is slow and cannot be used.

Can I use fifo(scrolling) chart in js scichart?

Version
v1.3.1514
  • You must to post comments
0
0

Hi there,

There is no DataSeries.FifoCapacity option in SciChart.js yet, as we’re building features according to customer need. However, you can achieve the same thing using our API as follows.

 // Given an XyDataSeries 
 const xyDataSeries = new XyDataSeries(wasmContext);

 // Create a function to append new x,y values and remove old values
 function scrollValues(xyDataSeries: XyDataSeries, xValues: number[], yValues: number[], maxCount: number) {
      if (!xValues || !yValues || xValues.length !== yValues.length) { 
             throw new Error("X,Y Values error");
      }
      // Append the new values to the DataSeries
      xyDataSeries.appendRange(xValues, yValues);
      if (xyDataSeries.count > maxCount) {
           // Remove old values from the DataSeries
           xyDataSeries.removeRange(0, xyDataSeries.count - maxCount);
      }
 }


 // Use the function
 scrollValues(xyDataSeries, [0,1,2], [1,2,3], 5);
 scrollValues(xyDataSeries, [3,4,5], [3,2,1], 5);
 scrollValues(xyDataSeries, [6,7,8], [1,2,3], 5);

 // Result should be xyDataSeries has 5 points, values are X=4,5,6,7,8 and Y=2,1,1,2,3

If you try that, let me know if it works for you. If it’s too slow (it shouldn’t be unless you are dealing with millions of points), we can put the FifoCapacity feature onto our roadmap which would greatly speed it.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies