Pre loader

Zoom and Pan mode

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

Hi,

How can I check, that chart is zoomed or paned?

Thanks,
Arthur

  • You must to post comments
0
0

Hi,

OK, try subscribing to IAxis.VisibleRangeChanged event, for when you either drag or zoom you chart, the VisibleRange is changed (maybe you need to have a flag indicates that chart is not updating).

Or you can inherit the RubberBandZoomModifier and ZoomPanModifier, override OnModifierMouseUp/Move and fire your own event there, then call base implementation.

Does this make sense for you?

Best regards,
Yuriy

  • Arthur Romanov
    Hi, I again try to working with real time chart, zoom and pan it when it working. When not zoomed and not paned I recalculate XVisibleRange and it's ok, data is adding into chart and XVisibleRange change. But when I try to zoom or pane I recalculate range as public void AddDataSeries() { lock (_timer) { var data = _dataSource.GetRandomWalkSeries(20); var dataSeries = _chartSeriesViewModel.DataSeries as XyDataSeries<DateTime, double>; if (dataSeries == null) return; using (dataSeries.DataSet.SuspendUpdates()) { dataSeries.Append(data.XData, data.YData); } var currentXRange = ChartManager.XVisibleRange.AsDoubleRange().Clone() as DoubleRange; if (currentXRange == null) return; var xMax = ((DateTime)dataSeries.XMax).Ticks; var xMin = ((DateTime)dataSeries.XMin).Ticks; if (currentXRange.Max < xMax) ChartManager.XVisibleRange = new DateRange(currentXRange.XMin, xMax); } } and entered always in if (currentXRange.Max < xMax) ChartManager.XVisibleRange = new DateRange(currentXRange.XMin, xMax); scope, because currentXRange.Max < xMax. In zoom mode I need to see chart only in zoomed visible range. Thanks, Arthur
  • 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