Hi, I’m trying to just create a simple WPF MVVM application that binds to the ViewportManager and add series dynamically. The data range (X and Y) will vary and I’d like to zoom to fit after a new series is added. Seems simple, but I cannot get it to work. I’ve tried calling ZoomExtents on a bound DefaultViewportManager as well as InvalidateElement() and InvalidateParentSurface(RangeMode.ZoomToFit) and they all have no affect. I was assuming I was doing something wrong, but if you try the WPF demo/sample application it does the same thing. If you go to 2D Charts -> MVVM Examples -> Manipulate Series MVVM, there is a call to AnimateZoomExtents that doesn’t work either after you add a series. You still have to double click on the graph after clicking the plus button to make it fit the graph. I just want to zoom to fit the data and not use code behind. The functionality is clearly there because if you define <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
it works perfectly, so how do I force that to happen from my view model? Thank you!
- Andy None asked 7 years ago
- last active 7 years ago