Error on stoping scrolling

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
JoseArmandoRT
Posts: 2
Joined: Wed Jul 17, 2019 3:46 am

Error on stoping scrolling

Post by JoseArmandoRT » Fri Jul 26, 2019 6:42 am

Hello,

I am new using Lightning Chart. I have an issue when i try to stop scrolling the chart. i get a line that begin on my last point and end in the beggining of the visualization. I am trying to stop scrolling with the "scrolling, layered axes" example, but nothing.

I will really apprecciate your help... the url is for the image.

https://unimodelo-my.sharepoint.com/:i: ... g?e=vuhikI

Code: Select all

 public void Gen_OnStopped()
        {
            //Disable rendering, strongly recommended before updating chart properties
            _chart.BeginUpdate();

            List<PointLineSeriesBase> listLineSeries = new List<PointLineSeriesBase>(_chart.ViewXY.GetAllLineSeries());

            //Take away the tracing hot point
            foreach (PointLineSeriesBase series in listLineSeries)
            {
                if (series.SeriesEventMarkers.Count > 0)
                {
                    series.SeriesEventMarkers[0].Dispose();
                    series.SeriesEventMarkers.RemoveAt(0);
                }
            }

            foreach (PointLineSeriesBase series in listLineSeries)
            {
                //Enable mouse hit test for series 
                series.MouseInteraction = true;

                //Convert all series event markers as 'TrackSeries'
                if (series is ITrackable)
                {
                    foreach (SeriesEventMarker marker in series.SeriesEventMarkers)
                    {
                        marker.VerticalPosition = SeriesEventMarkerVerticalPosition.TrackSeries;
                    }
                }
            }



            //Set scrollbar 
            //Arction.WinForms.Charting.HorizontalScrollBar scrollBar = _chart.HorizontalScrollBars[0];
            _chart.ViewXY.DropOldEventMarkers = false;
            _chart.ViewXY.DropOldSeriesData = false;

            //Set X axis to non-real-time scrolling mode
            _chart.ViewXY.XAxes[0].ScrollMode = XAxisScrollMode.None;

            //scrollBar.Visible = true;

            //put as milliseconds
            ulong minBarValue = 0;
            ulong maxBarValue = 10000;

            double minX = 0, maxX = 10;

            if (_chart.ViewXY.PointLineSeries.Count > 0 && _chart.ViewXY.PointLineSeries[0].PointCount > 0)
            {
                minX = _chart.ViewXY.PointLineSeries[0].Points[0].X;
                maxX = _chart.ViewXY.PointLineSeries[0].Points[_chart.ViewXY.PointLineSeries[0].PointCount - 1].X;
                minBarValue = (ulong)(minX * 1000.0);
                maxBarValue = (ulong)(maxX * 1000.0);
            }
            //Remove possible delimiter
            //scrollBar.Minimum = 0;

            //Remove possible delimiter
            //scrollBar.Minimum = minBarValue;
            //scrollBar.Maximum = maxBarValue;

            _chart.EndUpdate();
        }

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Error on stoping scrolling

Post by ArctionKestutis » Fri Jul 26, 2019 10:03 am

Hello,

As User's Manual describes,
5.3.1 Real-time monitoring scrolling
When making a real-time monitoring solution, the X axis must be scrolled to correctly show the current monitoring position, which usually is the time stamp of latest signal point. Set the latest time stamp to ScrollPosition property after the new signal points have been set to a series. LightningChart has several scrolling modes, selected using ScrollMode property.

5.3.1.1 None
No scrolling is applied when setting a value to ScrollPosition. This is often the selection to use when using the chart in other applications than real-time monitoring.
With ScrollMode = None you could set any range you like

Code: Select all

_chart.ViewXY.XAxes[0].ScrollMode = XAxisScrollMode.None;
_chart.ViewXY.XAxes[0].SetRange(minX, maxX);
The line from end to begging is most-likely due to last points being [0,0]. Please remove or correct it.

Hope this helps.
All the best.

Post Reply