Hi I am implementing a chart on Android with 24 Hours of data viewable in 1, 2, 4, 8, 12 and 24 hours windows. The chart is drag-able upon the xAxis only. The full extent of the yAxis is always visible.
I am struggling to control the rate of scroll compared to the drag speed. What is desired is always a perceived one to one ratio of movement. This means that a data point’s movement distance when scrolled is the same is the point of touch’s movement distance regardless of zoom level.
I am currently using:
ChartModifierCollection surfaceChartModifiers = surface.getChartModifiers();
XAxisDragModifier dragModifier = new XAxisDragModifier();
dragModifier.setDragMode(AxisDragModifierBase.AxisDragMode.Pan);
dragModifier.setClipModeX(ClipMode.ClipAtExtents);
surfaceChartModifiers.add(dragModifier);
ZoomPanModifier zoomPanModifier = new ZoomPanModifier();
zoomPanModifier.setClipModeX(ClipMode.ClipAtExtents);
zoomPanModifier.setDirection(Direction2D.XDirection);
zoomPanModifier.setZoomExtentsY(false);
surfaceChartModifiers.add(zoomPanModifier);
Currently however the ratio does not appear to be one to one the scrolling move further than the touch drag distance.
How can I achieve this?
- Simon Barnes asked 6 years ago
-
Hi Simon. I’m not sure that I understand what the problem is. What do you mean by ‘one to one’ ratio ( I tried both ZoomPanModifier and XAxisDragModifier with Pan mode – in both cases if I start panning around, for example, ’60’ label on xAxis after finishing pan finger is still near that label)? Maybe you can create some video which demonstrates this issue? Also do you use some other modifiers? In this case it could be possible that their behavior overlap with each other and you need to disable some of them.
-
In my latest build this does not appear to be an issue.
- You must login to post comments
Hi Simon
Is the issue resolved? In SciChart by default the ratio of drag pixels to drag on the screen is 1:1. I think its possible if you double-add modifiers to get some interacting badly as you’ve seen.
If you come across any issues like this in the future, let us know and we’ll do our best to help.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 6 years ago
-
Yes I consider the issue resolved, thank you.
- You must login to post comments
Please login first to submit.