Hi,
I set up my xAxis (DateAxis) with a minimalZoomConstrain = DateInterval.fromMinutes(3.0). And here is my PinchZoomModifier:
val pinchZoomModifier = PinchZoomModifier().apply {
direction = Direction2D.XDirection
receiveHandledEvents = true
}
The chart works great and restricts the zoom to three minutes, but I get this error to the console whenever I zoom in to reach the minimalZoomConstrain:
E/Axis: VisibleRange was restored to its last valid value. The range class com.scichart.data.model.DateRange (Min = Tue Jan 09 01:52:40 GMT+01:00 2020, Max = Tue Jan 09 01:55:40 GMT+01:00 2020) either is not valid or it doesn't satisfy MinimalZoomConstrain or MaximumZoomConstrain. To provide fallback value please override AxisCore#coerceVisibleRange(IRange) method
How can I get rid of this error? Is there a way to tell the PinchZoomModifier that there is a min limit?
- Erika Sankari asked 3 years ago
- last active 3 years ago
I need to do some calculation for data in visible range after zoom. Is there any notification when gesture ends in SCIPinchZoomModifier? If not, then that means I have to build a custom zoom gesture modifier? If so could you show me how pinch zoom is done in SCIPinchZoomModifier so that I don’t need to build everything from scratch? Thanks
- Haoran Xie asked 3 years ago
- last active 3 years ago
Hi Team,
I added the PinchZoomModifier to my chart. However, when we do the gesture it does not zoom, instead, it pans the y-axis.
Here is the code:
<s:SciChartSurface s:ThemeManager.Theme="BrightSpark">
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup>
<s:VerticalSliceModifier ShowTooltipOn="Never">
<s:VerticalSliceModifier.VerticalLines>
<s:VerticalLineAnnotation Style="{StaticResource SliceStyle}" X1="{Binding SelectedStartDate, Mode=TwoWay}" IsEditable="True"/>
<s:VerticalLineAnnotation Style="{StaticResource SliceStyle}" X1="{Binding SelectedEndDate, Mode=TwoWay}" IsEditable="True"/>
</s:VerticalSliceModifier.VerticalLines>
</s:VerticalSliceModifier>
<s:RubberBandXyZoomModifier ExecuteOn="MouseLeftButton"
RubberBandFill="#AA34aeeb" RubberBandStroke="#AAFFFFFF"
RubberBandStrokeDashArray="2 2"/>
<s:PinchZoomModifier XyDirection="XDirection"/>
<s:MouseWheelZoomModifier XyDirection="XDirection"/>
<s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
<s:YAxisDragModifier DragMode="Pan"/>
<s:XAxisDragModifier DragMode="Pan" ClipModeX="None"/>
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
<s:SciChartSurface.XAxis>
<s:DateTimeAxis AxisTitle="Time" VisibleRange="{Binding XVisibleRange, Mode=TwoWay}"
TextFormatting="dd-MMM-yyyy" SubDayTextFormatting="HH:mm:ss" DrawMinorTicks="True" />
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxis>
<s:NumericAxis AxisTitle="Distance" VisibleRange="{Binding YVisibleRange, Mode=TwoWay}"/>
</s:SciChartSurface.YAxis>
<s:SciChartSurface.RenderableSeries>
<s:XyScatterRenderableSeries DataSeries="{Binding Chirps}" >
<s:XyScatterRenderableSeries.PointMarker>
<s:EllipsePointMarker Width="9" Height="9" Fill="SteelBlue" Stroke="LightSteelBlue" StrokeThickness="2"/>
</s:XyScatterRenderableSeries.PointMarker>
</s:XyScatterRenderableSeries>
</s:SciChartSurface.RenderableSeries>
</s:SciChartSurface>
Can you please help me to know what’s wrong here?
- Richa Khurana asked 4 years ago
- last active 4 years ago
I am using a PinchZoomModifier with my chart and I would like to execute some code when the user stops the zooming action (stops touching the screen). Is it possible to do? Are there any listeners I could attach to the PinchZoomModifier? I couldn’t find any in the docs.
- MIha Rozina asked 4 years ago
- last active 4 years ago
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 4 years ago
- last active 4 years ago