SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.