If you set limit on range of axis, the pinch gesture will not work correctly.
Pinch the chart and hold for a while (about less than 1 sec), the chart will resize to the limit value you set on the axis.
You can change code of OscilloscopeFragment.java#106 in Examples to below to reproduce this problem.
final IAxis xBottomAxis = sciChartBuilder.newNumericAxis()
.withAutoRangeMode(AutoRange.Never)
.withAxisTitle("Time (ms)")
.withVisibleRange(new DoubleRange(2.5, 4.5))
.withVisibleRangeLimit(0,20) // this will help reproduce the problem
.build();
- zhengyang qu asked 5 years ago
-
Hi Zhengyang. I’m sorry I don’t understand how to reproduce this issue. I tried to add code you provided and use pinch zoom in Oscilloscope example and I didn’t see anything. Can you provide more detailed steps how to reproduce this issue? Thanks in advance.
-
Use pinch gesture to zoom the chart and don’t let your finger leave, after about 1 second, the chart will resize to its limited range. Sorry for my broken English.
- You must login to post comments
see this video.
- zhengyang qu answered 5 years ago
- last edited 5 years ago
-
Thanks for video. I think I could reproduce this issue on my PC. I’ve created a task for this issue – https://abtsoftware.myjetbrains.com/youtrack/issue/SC_DROID-636. For now please try next workaround – try to switch to uniform zoom for PinchZoomModifier ( it looks that this issue occurs only with non uniform zoom when X and Y direction is scaled independently) . To do this try to call setIsUniformZoom(true) on modifier instance (https://www.scichart.com/documentation/android/v2.x/webframe.html#SciChart.Charting~com.scichart.charting.modifiers.PinchZoomModifier~setIsUniformZoom.html).
- You must login to post comments
How can I apply this to the default modifier group? I tried using builder to build a modifier group with code below:
SciChartBuilder.instance().newModifierGroup()
.withZoomPanModifier().build()
.withPinchZoomModifier().withIsUniformZoom(true).build()
.withZoomExtentsModifier().build()
.build()
Bug of PinchZoom modifier seems gone, but the ZoomPan modifier is not working now.
- zhengyang qu answered 5 years ago
- You must login to post comments
Default modifier group is created using next code:
public ModifierGroupBuilder newModifierGroupWithDefaultModifiers() {
return newModifierGroup()
.withPinchZoomModifier().build()
.withZoomPanModifier().withReceiveHandledEvents(true).build()
.withZoomExtentsModifier().build();
}
I tried to use this code as base and added uniform zoom for PinchZoomModifier and it worked for me – all 3 modifiers work as expected.
Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroup()
.withPinchZoomModifier().withIsUniformZoom(true).build()
.withZoomPanModifier().withReceiveHandledEvents(true).build()
.withZoomExtentsModifier().build()
.build());
Best regards,
Yura
- Yura Khariton answered 5 years ago
- You must login to post comments
Please login first to submit.