I am using the XamDataChart to show several time based series of data. I hide the x and y axis of each series but I display a separate numeric x axis. I have minimum and maximum values of all x axes bound to the same view model property to keep them in sync. What I am trying to accomplish it to have the horizontal scroll bar indicate how much data is available and the relative position of the data being viewed compared to the full timeline. The tricky part id live data is coming in every second so the maxvalue is always increasing.
I have attached a sample that demonstrates where I am now. If the zoom bar is at the far right so that we are observing live data it all works fine. However, if the user scrolls back in time a little I set a flag called zoomed which I use to try to make the viewport stay in sync with incoming data in order to keep the data from moving. Since I am adding 1 second of time on a timer, I thought all I needed to do was to shift the WindowPositionHorizontal by 1 second as well and then adjust the WindowScaleHorizontal to also account for the added second. However, this logic is not working and I cannot seem to find the right calculation to make it work. The second thing I noticed is that as the user scroll to the left the graph movment gets less and less. I assume this is because the minimum value is fixed but is means the algorithm I use to shift the viewport will need to change as the user scrolls to the left. The reason for this is to show the user that data is still coming in meaning the scrollbar should appear to be moving to the left as well.
Please see the attached sample and let me know if my issues make sense and if there is a way to accomplish what I want. If there is a more standard or practical way to accomplish my I am open to that as well.
An added problem with this auto shifting is that since I am programmatically shifting the position and scale, if the user tries to scroll, the scrollbar will be reset which prevents the user from being able to scroll at all (unless they are faster than a second)
Hello Mike,
I am just checking if you got this worked out, or you still require any assistance, or clarification on the matter.
If this is what you were looking for please verify the answer so it helps other users as well.
Hi Mike,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
I have also uploaded a video showing how you can interact with the sample to get the functionality you wanted (usage.zip).
Please let me know, if I can be of any further assistance on the matter.
Excuse me for the late reply, however I needed to spare quite some time on this. Your requirement does make sense, but it always turned out to be as difficult, as it was confusing to make. Nevertheless I have made this behave as you would expect it to. As the visuals are animated, animation takes precedent and they cannot be accessed through the UI without stopping the animation, so I have put some functionality on the buttons. Here is the update version I made for you (DataChart_liveUpdate_scrolling_modified.zip).
Thanks Petar.
So building off your example, as data is coming in I need to be able to move the zoom thumb slider. In your example the scrollbar would not drag or resize very well. Another feature is that when the user is viewing the far right data should be moving to keep up with the live data, however as soon as the zoom thumb is moved from the far right at all the view needs to remain fixed at the selected times. During the time that the view is fixed data should still be flowing in and that should be apparent by the scroll bar thumb shrinking as the full timeline continues to grow.
Does that make sense?