SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
Hi,
is it possible to keep the Y axis unchanged with ZoomPanModifier (XyDirection=”XDirection”) and ZoomExtentsModifier?
The RubberBandXyZoomModifier allows this by setting ZoomExtentsY to “False”, but i don’t know how to do this for ZoomPanModifier and ZoomExtentsModifier.
Thanks,
Robin
Hello Robin,
yesterday I had to change that behavior in my application. Best way I found was to take out ZoomExtentsModifier and create a simple method that sets the visible range to minimum and maximum of that axis.
You will have to adapt a bit to your solution specially the GetCompleteRange (I have more then 1 yaxis)
hope it helps
<SciChart:SciChartSurface x:Name="chart" MouseDoubleClick="ModifierGroup_MouseDoubleClick" >
private void ModifierGroup_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ZoomExtents(); } public void ZoomExtents() { SetDistanceXAxisVisibleFullRange(); SetSpeedYAxisVisibleRange(); } public void SetSpeedYAxisVisibleRange() { SpeedVsDistanceAxis.AutoRange = false; SpeedVsDistanceAxis.VisibleRange = new DoubleRange(0, Properties.Settings.Default.VMax); } /// <summary> /// sets the visible range of the X axis to the full range /// </summary> public void SetDistanceXAxisVisibleFullRange() { double xmin, xmax, ymin, ymax; GetCompleteRange(out xmin, out xmax, out ymin, out ymax); ((NumericAxis) chartDistanceSpeed.XAxis).VisibleRange = new DoubleRange(xmin, xmax); } public void GetCompleteRange(out double xmin, out double xmax, out double ymin, out double ymax) { DoubleRange range = ((NumericAxis)chartDistanceSpeed.XAxis).GetMaximumRange().AsDoubleRange(); xmin = range.Min; xmax = range.Max; if (chartDistanceSpeed.YAxis == null) range = ((NumericAxis)chartDistanceSpeed.YAxes.GetAxisById("DefaultAxisId")).GetMaximumRange().AsDoubleRange(); else range = ((NumericAxis) chartDistanceSpeed.YAxis).GetMaximumRange().AsDoubleRange(); ymin = range.Min; ymax = range.Max; }
private void sciChart_MouseDoubleClick(object sender, MouseButtonEventArgs e) { XAxis.AnimatedVisibleRange = XAxis.GetMaximumRange(); }so i "regained" the ZoomExtentsModifier. The ZoomPanModifier is still missing but is also by far the less important modifier for me (at the moment).@SciChart Team: Nevertheless, it would be i nice feature to add the ZoomExtentsY property to both ZoomPanModifier and ZoomExtentsModifier. I wonder if i'm the first one with this usecase.Best regards, Robin
Please login first to submit.