Pre loader

Chart xAxis drag and scroll ratio

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

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?

Version
Api 27
  • Yura Khariton
    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.
  • Simon Barnes
    In my latest build this does not appear to be an issue.
  • You must to post comments
0
0

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

  • Simon Barnes
    Yes I consider the issue resolved, thank you.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies