Pre loader

How to mix AutoRange.Always and Zooming via Modifiers

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

0
0

Our charts receives data over time, so the visual range is continuously updated. This has effects on zooming since it also changes the visual range. So when the user tries to zoom at a part of the chart, the chart goes back to “normal” when a new sample is received (hence moving the time window). How do you solve this problem? I haven’t found any property that can tell me whether the user has zoomed the chart or not.

  • You must to post comments
1
1

Hi there,

Many people have used this as a way of solving this problem:

  • On MouseDown, disable AutoRange on the X and Y Axis of SciChart
  • On Mouse DoubleClick, enable AutoRange on the X and Y Axis of SciChart

This has the effect that when you mouse-down to zoom, the axis visiblerange stops updating in response to new data-points. Then, when the zoom is performed, the chart is frozen at that point in time. Finally, when you double click, the chart not only zooms to extents but autorange is re-enabled, so it continues to fit the data.

Another different technique is to not use AutoRange, but to manually update the VisibleRange of the chart, depending on whether the last point of the DataSeries is inside the viewport or not. Please see the article How to have a Fixed Scrolling Time-Range on the XAxis that works with Modifiers which explains how we achieved this in the Real Time Stock Charts example example.

Try that example -> Zoom in to the chart and then double click to zoom back out. It only updates the chart’s XAxis and YAxis VisibleRange when not zoomed.

Best regards,
Andrew

  • btsvennes
    Thank you. I've implemented something similar, but it's nice to know I wasn't that far of the track :-)
  • Oddvin
    Hi Regarding first section of the post. We have a request for similar functionality to be used for our realtime view. Where we want the X Axis labels(in our case showing time) to be stationary, just updating time. While the pens are moving along as new data is added. As opposed to the example from btsvennes, we show the current time not a fixed timespan (02:00 – 00:00). Is this possible.
  • You must to post comments
0
0

Hi Btsvennes,
Can you posted your code please to resolve this problem because i have the same problem but i don’t found a solution for this : always when i make the zoom the chart goes back to “normal” when a new sample is received !!
And thank you !
Sahar

  • You must to post comments
Showing 2 results
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