SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & 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!

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 aspublic 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 inif (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.