Search code examples
scichart

Limit for zooming out in SciChart


I have a graph, that needs to be zoomed and panned on the X axis. It has a range of labeled data points, and the idea is to be able to zoom in and move the graph horizontally when zoomed. I'm using a PinchZoomModifier and a TouchPanModifier to achieve this, and it works mostly correctly. But it shouldn't be possible to zoom out of the graph to see what's outside of my data point range, as it doesn't make sense in my context. How can I achieve this?


Solution

  • I don't know what platform you're targetting, but I'm assuming WPF (based on previous question history).

    You can limit zoom by using one of the techniques here for Clipping the Axis.VisibleRange on Zoom and Pan.

    All the SciChart platforms have similar methods to clip or limit VisibleRange. For instance, SciChart iOS has the VisibleRangeLimit API and SciChart Android has the MinimalZoomConstrain API

    Disclosure: I am the tech lead on the scichart projects