I have a XamDataChart that is periodically updated with new data. I clear the chart of all series and re-add new series and when this happens, the chart will momentarily blank before it displays the new data - it seems like the act of clearing and re-adding series takes time and the visual display is trying to draw in the intermediate state. Is there a way to prevent this from blanking until the entire chart is ready to be displayed?
Hi Gary,
How is the data updated? Are new points being added/removed or is the entire collection being replaced? In either case it would be better if you did not replace the entire series object. If you are adding/removing items periodically then INotifyCollectionChanged notifications should be enough to update your series. If you are replacing the entire collection then just assigning a new ItemsSource for the existing series is enough. Replacing the series each time is not necessary as long as you just update the ItemsSource.
I get a new set of data for the entire time span in question for every update. I do remove all of the series from the chart and then re-create the series. I put a lot of data on the chart and I see it seem to draw in segments (first lines are drawn, then after a second or so, bar (column series) are drawn), so I will see if it is reasonable to keep the series around and just change the underlying ItemsSource without too many changes to the code.
Thanks!
Were you able to try just replacing the ItemsSource on the series? Let me know if you have any further questions on this.
Thanks for the follow up Rob, I have not tried this yet, I probably won't get to it for a while. Thanks!