Pre loader

DateAxis VisibleRange



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?


  • You must to post comments

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,

  • 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