The complete message is: Unsorted data occurs in the collection. The only allowed SearchMode is Exact when FindIndex() is called on an unsorted collection, but Nearest was passed in.
I started with three renderable series that all had a certain time scale (x axis). I want to add another renderable series but it uses a separate time scale (x axis). I received this error so I put the two lists (x axis and y axis data) into a dictionary and used orderby on the dictionary key (time scale x axis list). I then cleared and appended this data to my DataSeries property. The code is still throwing this exception. What does unsorted mean?
Thanks.
Edit: The data is ordered by the key (timespan) in ascending order before I use orderby.
- Ryan Woods asked 8 years ago
- last edited 8 years ago
- You must login to post comments
I have a similar problem. When I’m running the app on my iPhone there’s no crash and the chart gets rendered with ease. But when I’m trying to run the app on the iOS Simulator it always throws the Unsorted Data error. I tried it on the Android simulator as well, but it gives me the Unsorted Data error over there too. I didn’t have time to check on a real Android phone, but I guess it could be the same. Do you guys have any idea what could that be?
P.S. I’m developing in Xamarin.iOS and Xamarin.Android.
Thanks,
Lazar Nikolov
[email protected]
- Lazar Nikolov answered 6 years ago
-
Strange error Lazar, can you submit a bug report or open a support ticket with steps to repro (if you are in support)? Our team will take a look. best regards, Andrew
- You must login to post comments
Hi Ryan,
This post explains why SciChart prefers sorted data, and what steps you can take to allow unsorted data by enabling this property here.
If you’re 100% sure you have data sorted in X (have output to console window and checked it), then you may have come across a bug. In that case, let us know the conditions to recreate the bug and we will investigate as soon as possible.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 8 years ago
-
I have no idea I’m afraid, but if you can recreate we can debug it and get to the bottom of the issue.
-
I figured it out! It was a silly mistake. As I was playing around with the values and learning about the different kinds of renderable series, I didn’t use the proper XyDataSeries property for the Append action. Thanks for your time!
-
That’s great! Glad you are sorted. Yes, the exceptions for unsorted data here http://support.scichart.com/index.php?/Knowledgebase/Article/View/17227/36/performance-tips-and-tricks are specifically designed to warn users if they have *accidentally* appended data unsorted in X. Intentional is fine if you set the DataSeries.AcceptsUnsortedData flag, just ideally you want the full power of scichart when your data ascends in X right?
-
Well, it is a confusing error to say the least. It tells me that the data is unsorted, but it is very clearly sorted. The issue was that, by appending a new data set to the series, it would throw an exception. It might have been that when I appended the new dataset to the dataseries, it found a conflict where the xaml for dataseries 1 and 2 were both bound to a certain x and y axis but they had different sets of data. i.e. the x values were different and it didn’t know how to handle that on the same x axis. What do you think?
-
I understand it. I thought about it a moment… I didn’t clear the data so while both data sets were ordered, appending one to another was not! Thanks again!
- 1 more comment
- You must login to post comments
Please login first to submit.