Pre loader

Scroll axis horizontally with few conditions

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


Hello everyone.

I have chart with adding data every second.

What i want to do:
– by dragging finger left, right – chart scrolls left and right (can go to past data, etc)
– by two fingers zoom gesture – it zooms (only horizontally with autorange by Y axis)
– i set a visible range limit to the right in this way: user can scroll to the right xMax to be in the middle (currently this part not working – and axis zooming, when i continue scrolling to the right)

I tried a lot of different modifiers, but none of them was ok.

My setup:

lineDataSeries.addObserver(new IDataSeriesObserver() {
            public void onDataSeriesChanged(IDataSeries<?, ?> iDataSeries, int i) {

                long addTime = 30_000 * currentTimeframe;

                runOnUiThread(() -> {
                    DateRange dateRange = new DateRange();

                    dateRange.setMinMax(new Date(0), new Date(lineDataSeries.getXRange().getMax().getTime() + addTime));


final DateAxis dateAxis = sciChartBuilder.newDateAxis()
    dateAxis.setMinimalZoomConstrain(25_000L * currentTimeframe); // 25 - 300 points
    dateAxis.setMaximumZoomConstrain(300_000L * currentTimeframe);

final NumericAxis yAxis = sciChartBuilder.newNumericAxis()
            .withGrowBy(new DoubleRange(0.1d, 0.1d))

ModifierGroup additionalModifiers = sciChartBuilder.newModifierGroup()
  • Yura Khariton
    Hi Vadim. Unfortunately I’m not sure that I understand what you’re trying to achieve. Can you provide more detailed description of desired behavior? Maybe you have some videos or gifs which can show it?
  • Kirey Vadim
    Hi Yura. Just realised the reason of such behaviour: lets say current Xmax in dataSet is 16:00:00, i use setVisibleRangeLimit to set this limit to 16:00:40 (+40 seconds of current max). When i scroll right (to see more data from future) – scrolling should be disabled. Instead chart starts to zoom, because i set dateAxis.setMinimalZoomConstrain(25_000L); (this means my Xaxis can be zoomed up to 25 seconds on full screen width). Can send a video if problem is still not clear. Thanks for helping.
  • Yura Khariton
    Video would be very helpful or maybe you can attach entire project so I could debug in on my PC to find out why this zoom occurs. Thanks in advance.
  • Kirey Vadim
    Added short video to post
  • You must to post comments
Best Answer

Hi Vadim,

Can you try to update to our latest nightly build ( v2.2.2.2433 ) and try to change clip mode target for ZoomPanModifier to VisibleRangeLimit so during scrolling VisibleRange will be clipped to VisibleRangeLimit because by default it clips VisibleRange to MaximumRange which could result zooming effect which I’ve seen on video:


Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.