Hi,
How can I check, that chart is zoomed or paned?
Thanks,
Arthur
- Arthur Romanov asked 11 years ago
- You must login to post comments
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
- Yuriy Zadereckiy answered 11 years ago
-
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 login to post comments
Please login first to submit.