Hey super helpful and awesome SciCharts gurus,
I’m trying to create a graph that has usable data in a specific range, say 80-100, and I’m wondering if there is a way to lock the y axis range absolutely? This would override any kind of updating that ZoomPan or other modifiers might try to do.
Thanks!
Ryan
- rcannon asked 11 years ago
- You must login to post comments
Yes, there is a way to do this.
Check out the ViewPortManager feature. This is a back-door API into the chart which allows you to intercept VisibleRange changes during the render pass. If you create a custom DefaultViewportManagerBase and put breakpoints in the methods you will see where this is called – basically any time the chart renders.
You can keep a ViewportManager in your ViewModel and bind it to SciChartSurface.ViewportManager, that way when you append data or have a disconnection issue you could set a flag on your custom viewport manager to freeze the VisibleRange for a specific axis.
Also, you may not be aware but many of the modifiers have flags to restrict action to just X or just Y direction, e.g. see here: http://http://www.scichart.com/Abt.Controls.SciChart.SL.ExampleTestPage.html#/Abt.Controls.SciChart.Example;component/Examples/IWantTo/ZoomAndPanAChart/MouseDragToPanXOrY.xaml
I hope this helps!
Andrew
- Andrew Burnett-Thompson answered 11 years ago
-
That helps and points out how much I still need to learn. Also, I know that something like ZoomPan can be restricted to a single axis but, say you have a decaying sine wave, when you pan the X Axis the Y Axis Visible Range still changes. What I'm looking for is a way to set the visible range once, either dynamically or hard coding, and have it never change unless I intend it to. That way when I pan you can see as the sine wave diminishes.
- You must login to post comments
Sounds to me all you need is to set Axis.AutoRange = AutoRange.Never, in combination with an Axis.VisibleRange.
Our default autorange method tries to range on startup then never does again. In most cases this is fine but ‘AutoRange.Never’ disables it.
See here for more info: http://http://www.scichart.com/documentation/webframe.html#AutoRangeNeverVsAutoRangeAutoVsAutoRangeAlways.html
- Andrew
- Andrew Burnett-Thompson answered 11 years ago
- You must login to post comments
Please login first to submit.