Pre loader

VisibleRange.SetMinMax values not being applied when RubberBandXyZoomModifier has been used last?


Due to the user often needing to select pre-specified ranges of data to view, I handle the X- and Y-axis VisibleRange manually in code.
I also have both RubberBandXyZoomModifier and MouseWheelZoomModifier enabled.
Instead of using a generic ZoomExtentsModifier (which would show all data), I handle a MouseDoubleClick in code and set the VisibleRanges to the bounds of the user-selected data area’s range.

Now if the RubberBand zoom is used followed by a double-click, the VisibleRange.SetMinMax function gets called with the correct values in my code, but that range does not appear on the chart. However if a MouseWheelZoom is used after the RubberBand zoom, it works fine. Is there something about the RubberBand zoom that is stopping the VisibleRange.SetMinMax function values from being recognized by the chart?


  • You must to post comments

Thanks Andrew…that worked!

Is there a way to make it so any user zoom can’t move the VisibleRange below the 0-values on the axes? Or is this getting into an area where I should just encapsulate all this functionality into a databound ViewportManager?


  • You must to post comments

Very very simple workaround for you.

Instead of

axis.VisibleRange.SetMinMax(newMin, newMax);

Try this

axis.VisibleRange = new DoubleRange(newMin, newMax);

Does that solve the problem?

If that doesn’t work, do you have any VisibleRange bindings in XAML in your code? If you do, please ensure they are TwoWay bindings.

Best regards,

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies