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

0
0

Hi,
I’m having trouble with YAxis VisibleRange and ZoomExtentsModifier. I want to change the display range of the Y axis dynamically by changing Min and Max of VisibleRange of YAxis from ViewModel. But when ZoomExtentsModifier is executed by double-click etc, Min and Max changes of VisibleRange are not reflected on the screen. If the screen is enlarged or reduced by means other than ZoomExtentsModifier, this state will be resolved and the changes will be reflected.
Please let me know any solution.

Version
5.1.1.11473
  • Andrew
    Hello, the following namespaces cannot be found in the example. Which NuGet packages do I need? “using Reactive.Bindings; using Reactive.Bindings.Extensions; using Reactive.Bindings.Helpers; using System.Reactive.Linq;”
  • yo kobayashi
    Thank you for your reply. I’m using these NuGet packages. – ReactiveProperty 5.6.0 – PropertyChanged.Fody 2.6.1
  • You must to post comments
0
0

Thank you for your sample code and the information about the missing NuGet packages.

If you change this line of code in your MainWindowViewModel.cs, it works

Before:

        ResetYVisbleRangeCommand.Subscribe(() =>
        {
            foreach(var a in YAxisList)
            {
                a.VisibleRange.Min = 0.0;
                a.VisibleRange.Max = 50.0;
            }
        });

After:

        ResetYVisbleRangeCommand.Subscribe(() =>
        {
            foreach(var a in YAxisList)
            {
                a.VisibleRange = new DoubleRange(0.0, 50.0);
            }
        });

Now it seems to work as expected.

It is recommended to set a new VisibleRange not to re-use the existing ones throughout SciChart. For types of VisibleRange to match axis, see here: https://www.scichart.com/documentation/v5.x/Axis%20Types%20in%20SciChart.html

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

SciChart WPF v6 BETA released! Note pricing/licensing changes are coming. Contact us to beat the rise!Read more
+