Hi
I’m using auto range on a numeric axis. The data can be anything, but I want the axis to never have a range of less than 5.
E.g.: -100 to -95
E.g.: 17 to 22
E.g.: 0 to 5
etc.
What do I need to set to be able to do this? I have tried MinimalZoomConstrain and VisibleRangeLimit without success. Preferably something to set in XAML on my axis.
Thanks.
- Henning Bjørgo asked 9 years ago
- You must login to post comments
I ended up with subscribing to the “DataRangeChanged” event on the axis and calculated the desired range myself and set the “VisibleRange” on the axis.
- Henning Bjørgo answered 9 years ago
-
Hi Henning, that will do it, but I would also suggest using AxisBase.VisibleRangeChanged instead and checking the e.NewVisibleRange.AsDoubleRange().Diff value. If it is outside of the desired bounds, set it back to the e.OldVisibleRange. Hope this helps!
-
Hi Andrew, I did this (I need the x range to start at 0 and the user shouldn’t be able to pan beyond that) but now the chart “falls back” to zooming when I try to pan beyond 0, is there a way to avoid this? It simply has to stop at 0, that’s it. And I do need the zooming, but with an explicit pinch gesture, using 2 fingers…
- You must login to post comments
Please login first to submit.