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?
- 동윤 이 asked 3 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 3 years ago
- last edited 3 years ago
- You must login to post comments
Please login first to submit.