Pre loader

How to use GrowBy?

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

0
0

My problem is that I’m setting VisibleRange of the DateTimeAxis dynamicaly. Can i use staticly declared GrowBy property to add offsets to current Min and Max values?

  • You must to post comments
1
0

Hi there,

GrowBy is applied to the chart if it’s zoomed to extents or if IAxis.AutoRange=”True”. But you can apply it whenever you want, after setting VisibleRange in your case. I think I can be done by

Axis.VisibleRange.GrowBy(Axis.GrowBy.Min, Axis.GrowBy.Max);

Also you could take a look at this post, which shows how to use ViewportManager feature, which allows you to do the same in more natural way.

Hope this helps!

Best regards,
Yuriy

  • sarat12
    Thanks for fast reply! Looks like it should solve the problem but for some reason, input params (min, max) don't influence on the result even if they are zeros and my chart looks like attached screen shot.. Without GrowBy method, line starts on the left side of viewport and ends on the right.
  • sarat12
    Sorry, it was my mistake about params influencing. But the left padding grows every time i use it, which is not acceptable.. Ok it's not a big problem.
  • Yuriy Zadereckiy
    Hi, Glad you solved it! Quick tip to avoid left-padding growing: you could create new range every time and apply GrowBy to it, rather than modifying axis.VisibleRange directly. Something like that: var newVisibleRange = RangeFactory.NewWithMinMax(axis.VisibleRange, newMin, newMax); newVisibleRange.GrowBy(Axis.GrowBy.Min, Axis.GrowBy.Max); Axis.VisibleRange = newVisibleRange; Hope this helps! Yuriy
  • 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