Hello,
I have real-time chart with sorted X axis. It is OK for me because data which displayed on chart comes from industrial equipment with “always incremented” X value. But sometimes process stop. In this case industrial equipment received values near last before stop (differed by 5th or 6th decimal sing). And in this case I don’t need to build chart. I will want check new X values for they next value must be more than previous, because now I have error “Data has been Appended to a DataSeries which is unsorted in the X-Direction. Unsorted data can have severe performance implications in SciChart”.
For Y values DataSeries has DataSeries.LatestYValue and I can compare it to new value. What the best way to avoid adding ‘less than last’ value for X axis.
- Fedor Iudin asked 11 months ago
- You must login to post comments
Hello Fedor,
Thanks for your inquiry.
To avoid the mentioned exception, you can set the AcceptsSortedData property to True for the DataSeries.
However, the application may lose some performance working with unsorted data.
DataSeries.AcceptsSortedData = true;
For more details please see the following “Performance Tips & Tricks” documentation article:
https://www.scichart.com/documentation/win/current/webframe.html#Data%20Performance%20Tips.html
With best regards,
Lex S., MSEE
SciChart Technical Support Engineer
- Lex answered 11 months ago
- last edited 11 months ago
- You must login to post comments
I was afraid my question would be misunderstood. I don’t want to avoid this error and make the DataSeries unsorted. I just need to avoid adding unsorted data. The question is simple. If I have in code newX variable which contains new X value for add to DataSeries what expression I need to write to avoid error in main question?
if (newX > [???])
{
DataSeries.Append(newX, newY);
}
What is [???] equal to in code above? DataSeries.XMax?
- Fedor Iudin answered 11 months ago
- last edited 11 months ago
- You must login to post comments
Please login first to submit.