SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

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.

  • You must to post comments
0
0

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.

  • Andrew
    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!
  • Ivan Schütz
    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 to post comments
Showing 1 result
Your Answer

Please first to submit.