Pre loader

Axis range

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

Hi,

I feel this should be obvious but I cannot find the answer in the docs. I have multiple Y axis and I want all of them to start at 0 and autoRange only the max value. Also, the zooming should not be affected, it should have normal behavior. I just want the axis to go from 0 to auto max value when we call ZoomExtents(). The default behavior of the ZoomExtents() is auto min value to auto max value.

Is there any way we can achieve this with SciChart?

Thank you,
Alex

Version
8.3.0.28019
  • Alexandru Neamtu
    I have tried to use the GrowBy method setting the min for every Y axis to something huge like 1e100 and the max to 0.1 (10%). Then by using the VisibleRangeLimit I have limited the visible range to (0, max value computed by GetMaximumRange().Max). This works but we lose the padding of 10%, which is normal because 10% is computed from “max of serie” – “min of serie”. Is there any other strategy that lets us keep the 10% margin above the max value?
  • You must to post comments
0
0

Hi Alex

Clamping Axis.Visiblerange in SciChart WPF can be achieved with a VisibleRangeChanged event handler

Take a look at Clipping the Axis.VisibleRange on Zoom and Pan

Clipping Axis.VisibleRange in Code To clip the VisibleRange and force a certain maximum or minimum, just use the following code:

axis.VisibleRangeChanged += (s, e) =>
  {
     // e is VisibleRangeChangedEventArgs
     // Assuming axis is NumericAxis
  
     if (e.NewVisibleRange != null && e.NewVisibleRange.Min < 0)
     {
        // Force minimum visiblerange to zero always
        ((NumericAxis)sender).VisibleRange = new DoubleRange(0, e.NewVisibleRange.Max);
     }
  };
  

There are other methods in there such as using VisibleRangeLimit but these have their limitations (no pun intended), such as not clamping when user zoom/pan occurs

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.