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


I want YAxis Auto Scale less than the value max 10% and greater value min 10%, how?

  • You must to post comments

Ok I’ve investigated this and there’s a couple of ways to do it. The code to achieve a positive padding (e.g. 10% above max, and 10% below min) is as follows:

// C#
var axis = new NumericAxis();
axis.AutoRange = true
axis.GrowBy = new DoubleRange(0.1, 0.1);


<!-- XAML -->
<NumericAxis AutoRange="True" GrowBy="0.1, 0.1"/> 

You could try this with negative values but we haven’t tested it.

A more advanced solution is to create a custom ViewportManager.

See class DefaultViewportManager in SciChart. If you inherit this, you can override how the YAxis and XAxis ranges are set during each redraw.


public class MyViewportManager : DefaultViewportManager
    protected override IRange OnCalculateNewYRange(IAxis yAxis, RenderPassInfo renderPassInfo)
        // If Axis.AutoRange = true, then this is the zoomed to fit VisibleRange
        var rawAutoRange = base.OnCalculateNewYRange(yAxis, renderPassInfo);
        // Shrink this by a factor and return - to scichart core rendering
        return rawAutoRange.GrowBy(new DoubleRange(-0.1, -0.1));

The usage of a ViewportManager is as follows

SciChartSurface.ViewportManager = new MyViewportManager();

Let me know which solution you used, and if they did the job!

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.