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

1
0

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?

Thanks!

Version
4.0.6.8540
  • You must to post comments
0
0

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,
Andrew

  • You must to post comments
0
0

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?

Thanks!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.