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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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