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

0
0

Hi there,
I’m trying to catch a VisibleRangeChanged Event of a DateTimeAxisViewModel, but it is never called.
Strangely, it work’s with a numeric axis viewModel?!
I’m refering to the AxisBinding and Annotation Binding Example in the Examples Suite.
I added a MouseWheelZoomModifier to be able to change the VisibleRange

 <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:MouseWheelZoomModifier>
                    </s:MouseWheelZoomModifier>
                </s:ModifierGroup>
 </s:SciChartSurface.ChartModifier>

In the InitializeAxes method in SciChartMvvmBindingsViewModel two lines were added to catch the VisibleRangeChanged Event:

            var xNumAxis = new NumericAxisViewModel
            {
                AxisAlignment = AxisAlignment.Bottom,
                AxisTitle = "XAxis",
                DrawMajorBands = false,
                TextFormatting = "0.00#",
                VisibleRange = new DoubleRange(0, 10),
                BorderThickness = new Thickness(3),
                BorderBrush = new SolidColorBrush(Colors.CadetBlue)
            };
            xNumAxis.VisibleRangeChanged += xNumAxis_VisibleRangeChanged; //catch num axis event
            XAxes.Add(xNumAxis);

            var xDateTimeAxis = new DateTimeAxisViewModel
            {
                AxisAlignment = AxisAlignment.Top,
                Id = "DateTimeAxis",
                VisibleRange = new DateRange(new DateTime(2017, 1, 1), new DateTime(2017, 1, 31)),
                StyleKey = "DateTimeAxisStyle"
            };
            xDateTimeAxis.VisibleRangeChanged += xDateTime_VisibleRangeChanged; //catch date time axis event

            XAxes.Add(xDateTimeAxis);

Now, when I change the zoom level I jump into the xNumAxis_VisibleRangeChanged-method, but never in the xDateTime_VisibleRangeChanged-method.

Version
5.0.0.10712
  • You must to post comments
0
0

Hi there,
It looks like I am getting the same issue although I understand it is 3 years old and it has been resolved since then. I am using the .NetCore3 version of SciChart WPF and my code is very similar to the above. The VisibleRangeChanged event is caught for the Numeric axis but not for the DateTime Axis.

Version 6.2.0.13254

Thanks

  • You must to post comments
0
0

Hi Tim

Some of the axis were missing bindings to enable the VisibleRangeChanged handler in the viewmodel.

I have added these in build 5.1.0.11333 of SciChart WPF.

These will be published to our next nightly build.

Best regards,
Andrew

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.