Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3590
XamDataChart and SyncManager...How exactly do they interact?
posted

I have a XamDataChart that I created that receives live data every second. I needed the ability to allow the user to pan and scroll the view and when the user is not looking at the right axis I needed the view to be static but still indicate that data was flowing in. To accomplish this I had to check see if the user was looking at the far right by adding the ActualWindowPositionHorizontal and ActualWindowScaleHorizontal together to see if it equals 1. If not then the user either panned or zoomed and therefor I need to keep the view static. To accomplish that I handle the OnWindowRectChanged event and I shift WindowPositionHorizontal 1 second to the left and shrink the WindowScaleHorizontal to the appropriate amount to maintain the exact position and size until the user resets the view to the far right. I have this working,however, now I have 3 XamDataCharts linked via the SyncManager. I have all 3 charts' series' xaxes' Minimum and Maximum vales bound to the same viewmodel properties as I did in the control with only a single datachart. What I find is that as soon as one fires the OnWindowRectChanged is fired the others fire as well and this causes a recursion error and the app crashes. What I need to know is how am I supposed to manually update WindowScaleHorizontal and WindowPositionHorizontal properties on synced datacharts? Is there a way to make the user's view "fixed" when zoomed/panned without modifying the position and scale each time the datasource gets more data added to it and the xaxes' MaximumValue is increased? Should only one of the charts xaxes' MaximumValues be bound to the viewmodel since they are synced?

I am attempting to come up with a sample to reproduce my problem but the charts have a lot of companion code that is making it time consuming.

Please let me know if you need more detail. 

Parents Reply Children
No Data