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


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

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,

  • 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.