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?
- sarat12 asked 11 years ago
- You must login 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,
Yuriy
- Yuriy Zadereckiy answered 11 years ago
-
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.
-
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.
-
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 login to post comments
Please login first to submit.