Pre loader

DateAxis VisibleRange

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,

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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies