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, Does anyone have any example of zooming in/out with live data on graphs? I've notice that when data is updated frequently, 20+ times a second, I'm not able to zoom at all. Andy |
|
|
Hello Andy This is a slight limitation of the way the chart works. Whenever the minimum or maximum values are changed in some way, the chart will automatically set the actual-minimum and actual-maximum (viewport values) to match the min and max values. In most scenarios this is exactly what you want, such as when the items source in each series is set, you want the viewport to initially show all the data (unless otherwise specified). Unfortunately this makes viewport manipulation difficult when the data is rapidly changing in a way that the min and max values change - as you have observed. This is already on my list of things to look into - either by smarter logic, or by an option to turn the automatic logic on or off. Both these will require some thinking, and so don't plan to do this immediately. I have observed good result by doing this: In the main place you are dynamically updating the data, store the ActualMinimum and ActualMaximum value of each axis in a local variable, then perform the dynamic data change, and then restore the ActualMinimum and ActualMaximum value back to each axis. I hope this helps! -Jason Fauchelle |
|
|
Hello Andy I've made this easier for you by adding a new property called IsAutoViewportEnabled on the ChartAxis. This is basically the option that I briefly mentioned previously. It is not implemented to the full extent of my original plans, but it will help you out in your scenario. Now, in the main place where you dynamically update the data, you can set IsAutoViewportEnabled to false on each axis, then perform the data update, and then set the property back to true on each axis. You could even experiment with setting the property to false on each axis after the chart has initially loaded, and then just leave it as false. It gets a bit more difficult if you want to be able to zoom dynamically changing data AS WELL AS have the viewport update automatically when the chart is not being zoomed. If you want this behavior, you'd want to check to see if each axis is zoomed before changing the data (ActualMinimum != Minimum, and same with Maximum). Then, if an axis is zoomed, set IsAutoViewprtEnabled to false, but if it's at maximum zoom, keep it as true. Let me know if you have questions about this. -Jason Fauchelle |
|
|
Hi Jason, Thanks for adding that capability in for me. Unfortunately I'm still unable to get it working properly. I think when data is updating rapidly, if a user tries to draw the zooming rectangle, it will reset the draw before they can finish the process, hence they will never be able to zoom because once they click on the graph it already reset the drawing (and the zoom rectangle). Is there a way around this? Thanks again for your help, Andy |
|
|
Hello Andy Thanks for pointing this out, I had been testing with mouse wheel zooming, Ctrl+mouse panning, and dual-sliders - but not the zoom box. The zoom box has never worked while the data is changing, but I've updated this to work in the next nightly build. -Jason Fauchelle |
|
|
Hi Jason, Thanks, the rectangle is now showing up and allowing me to zoom now. Sorry to be picky but, one thing I've notice is, if the Y axis is reversed, the drawing of the box is and the initial click is not set properly. And when panning, the original zoom rectangle seems to still show up? Thanks again your awesome, Andy |
|
|
No worries Andy These issues will be corrected in the next nightly build. -Jason Fauchelle |
|
|
Thanks Jason. Its looking good.. One more thing, The Y axis will zoom in and hold its min/max value. But the X axis will zoom in/out once the graph refreshes. Could you fix that when you get a chance? Thanks again.. Andy |
|
|
Hello Andy I have not been able to reproduce this. The X axis should not do this as long as you set IsAutoViewportEnabled before and after you dynamically change the data. Though it is a new feature, so there may be a scenario that causes the viewport to be reset. If it is still not working, please send some sample code so I can try reproduce this. -Jason Fauchelle |
|
|
Hi Jason, I think it works for the normal X and Y axis but once an Alternative Axis is used it starts to behave oddly. I also noticed that when I get the Y axis to zoom in properly, the data being displayed doesn't seem to be zoomed in (the graph still shows everything ). I'm not sure whats causing it but I've noticed it on both the Line graph and the heatmap as well, both behaves a little differently but it may be the same issue. For example, I coded in a pause and resume capability so I can pause/resume the real time heatmap updates. What I noticed is (X axis is based on time or ticks) if the data is within the set maximum value, I'm able to pause and zoom in ok. But once it goes out of the range I am reseting my min/max (panning window with the data). Once this happens, none of the zooming will stick. The Y axis will say its zoomed in but the data is showing everything. At this point, I reset/clear the data in the graph and the zooming will never work again until I reset the application. Could you check into this please? Thanks for the help again, Andy |
|
|
Hello Andy Unfortunately I have not been able to reproduce this. The Y axis data not aligning with the Y axis sounds bad, but I can't work out how that would be possible. Hopefully all the issues can be solved by setting IsAutoViewportEnabled based on the current viewport values (ActualMinimum/Maximum) in relation to the max viewport values (Minimum/Maximum), and also manually setting these values when necessary. To aid you further in this, I'd need a repro project to work with, as the way I'm trying to set this up is probably different to your scenario. -Jason Fauchelle |
|