Pre loader

Axis offset at the top and bottom

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

I want to set the gap between top and bottom of the axis with respect to the data for example if my data range is between 3 to 15 then i want to set the visible range 2 to 16 like that.The same is happened when the chartsurface.zoomextents(),how the offset is calculated,how can i set manually?. Please see the attached images how can i set the same gap as manually like zoomextents.

Images
  • You must to post comments
0
0

Good morning Raghupathy,

In order to add a gap above/below data always, firstly you can use AxisBase.GrowBy. This adds a fractional amount above and below the data when auto-ranging or zooming to extents. For instance:

// Adds 10% below Min and 20% above Max
AxisBase.GrowBy = new DoubleRange(0.1, 0.2);

If you require precise control over the Axis VisibleRange on zoom extents, you will need to override AxisBase.GetMaximumRange()

public class CustomAxis : NumericAxis
{
    public override IRange GetMaximumRange()
    {
        var baseRange = base.GetMaximumRange() as DoubleRange;

        // Always return a range with +/- 1 padding
        return new DoubleRange(baseRange.Min - 1, baseRange.Max + 1);
    }
}

Best regards,
Andrew

  • Raghupathy
    Thank you Andrew it helps a lot.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies