Pre loader

Unsorted data adding to the X-Direction

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


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.

  • You must 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:

With best regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • You must 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?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.