SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
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?
Very very simple workaround for you.
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.
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?
Please login first to submit.