when loading first data everything goes fine
growby max padding as expected (Image1)
but i added realtime data and data grow, it show strange behaviour, padding more than i expected. (image2)
final IAxis xAxis = sciChartBuilder.newCategoryDateAxis().withVisibleRange(xVisibleRange).withGrowBy(0.1,0.1).build();
ZoomPanModifier zoomPanModifier = new ZoomPanModifier();
zoomPanModifier.setClipModeX(ClipMode.ClipAtExtents);
zoomPanModifier.setClipModeTargetX(ClipModeTarget.MaximumRange);
any workaround? thanks
- Yuda Susanto asked 3 years ago
- You must login to post comments
Hi there,
May I ask how many points do you have? GrowBy in X direction adds additional space based on amount of all points that your data series have. So for example if you set GrowBy = (0.1, 0.1) this means to add additional 10% of space occupied by data in X direction. If you have 201 points and use category axis then your data will rendered in range from 0 to 200, then after applying GrowBy with additonal 10% from each side MaximumRange will be (-20, 220). If you zoom deep enough using PinchZoomModifier or just set VisibleRange, for example (190, 210), and then try to pan chart you may see picture like on your screenshot, because ZoomPanModifier doesn’t limit size of viewport window ( diff between max and min of VisibleRange for axis). This is how it works by default. If you don’t want this behavior I would suggest you to try to limit depth of zoom to prevent this by using MinimalZoomConstrain.
Best regards,
Yura
- Yura Khariton answered 3 years ago
-
Oh i see, so the more data i load the more padding will increase
-
but im disabling pinchzoommodifier, how to keep padding (ie 25 data index ahead from data series size) even when the data series keep grow?
-
Well you can override how MaximumRange is calculated by creating custom axis, or more simpler solution would be using VisibleRangeLimit property (https://www.scichart.com/documentation/android/current/webframe.html#Axis%20Ranging%20-%20Restricting%20VisibleRange.html). You can set it as ClipModeTarget for ZoomPanModifier (https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.ClipModeTarget.html) so modifier will use it for clipping instead of MaximumRange. Then you need to update VisibleRangeLimit when you add new data into your data series ( e.g. for min it will always have -25 value and for max it will have amount of data points in data series + 25, because you’re using CategoryDateAxis which is index based so all ranges for this axis will be indices of points in data series )
- You must login to post comments
Please login first to submit.