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

0
0

Hi,

I’m using SCiChart version 2.0 and trying to use the VisibleRange in realtime mode with zooming mode on DateTime axis. I want to when chart is zooming I see only zoom area, and chart shouldn’t be calculate VisibleRange, after that, when I’m double clicking on the surface, the chart should be continue working in realtime mode.

                var visibleMax = (DateTime)Properties.XAxis.VisibleRange.Max;
                var seriesMax = (DateTime)provider.DataSeries.XMax;
                if (_lastXMax != null && !Properties.XAxis.VisibleRange.IsZero)
                {
                    var diff = seriesMax.Subtract((DateTime)_lastXMax);

                    if (visibleMax + diff >= seriesMax)
                    {
                        var existingRange = (DateRange)Properties.XAxis.VisibleRange;
                        var newRange = new DateRange(existingRange.Min, visibleMax + diff);
                        Properties.XAxis.VisibleRange = newRange;
                    }
                }

                _lastXMax = provider.DataSeries.XMax;

But when I’m double clicking on the surface, the chart is froze(visible range doesn’t calculate correctly).. How can I calculate the VisibleRange correctly?

Thanks,
Arthur

  • You must to post comments
0
0

Hi Arthur,

There isn’t any built-in way to check if chart is zoomed. Alternatively, you could try firing some event after zooming (see Event after zoom in thread), or compare current VisibleRange with actual DataRange.

Best regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.