Pre loader

Chart xAxis drag and scroll ratio


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();

    ZoomPanModifier zoomPanModifier = new 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?

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

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,

  • 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