This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Jason, Sometimes we need to plot line chart (or maybe others) where some of the data is missing. In such cases we would normally want to have a discontinuity in the line (in other cases maybe we would interpolate, but that is not a problem). How can we accomplish this the Mindscape line series? Thanks |
|
|
Hello Peter This can be done by adding null to the items source. So you can set the ItemsSource of a chart to be a list containing Point objects and nulls. Whenever the LineSeries comes across a null, it will break the line and start a new line at the next non-null. This is built in functionality which you can try for yourself right now. Note that this functionality is only available in the LineSeries for now. I plan to do some refactoring to make it easier to add this feature to the other series. This is a pending feature for now. If there is a particular series that you need this functionality in, let me know and I'll increase its priority. -Jason |
|
|
Hi Jason, Thanks for the quick response (as usual!). However, in the typical case (for us at least) this seems a bit inconvenient because we use the same ItemsSource for all series, with the YBinding set to a different property for each series. We would have to create a duplicate ItemSource for each series, and then go through each property value for each series and check for invalid data (we use NaNs), and if found set that entry in the ItemsSource for that particular series to null. Would it be possible for the line series to treat a NaN value in the same way as it would a null item? This would be much more convenient and seems very natural. For other data types (e.g., DateTime) a different invalid value might apply (e.g., default(DateTime)). The same functionality ought to apply to other series types as well--if there is a NaN value in a bar series no bar should display for that value (I'm not sure what happens now). Thanks Peter |
|
|
Hello Peter Thanks for the suggestions. In the next nightly build you will find that NaN property values are treated the same way as null items. null property values will also create missing data points. So for objects such as DateTime, if you use a DateTime? property so that you can set it to null, this will skip that data point. Note that only one property (either X or Y) needs to be null or NaN for the data point to be skipped. Also note that this is still only availble in LineSeries. Get the next nightly build, try it out and let me know if this is all good. Let me know if there are any other particular series that you need this functionality in. Cheers -Jason |
|
|
Hi Jason, I tested your change and it seems to work great. Thank you! I am not sure if I will need this in any other series, but it seems to me that similar behavior would make sense in other series types. I'm not sure what happens now in scatter series, for example, but if an invalid value turns up in a scatter series I would hope only that point would not show, rather than the whole series disappearing. Peter |
|
|
We will definitly be implementing this feature in the other series before long. At the moment the other series crash when trying to deal wth invalid data. Let us know at any time you find that you need this feature in a particular series. -Jason |
|