SurfaceGridSeries3D InsertRowBackAndScroll Backwards

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

Posts: 1
Joined: Fri Feb 15, 2019 3:00 pm

SurfaceGridSeries3D InsertRowBackAndScroll Backwards

Post by rmolenhouse » Fri Feb 15, 2019 3:10 pm


I am using a SurfaceGridSeries3D to chart temperature data. We take a measurement once per second and I am using the InsertRowBackAndScroll method to add new measurements each second. The chart is displaying the last 5 minutes worth of measurements.

My question is, Is there a way to use the InsertRowBackAndScroll method, but insert the row to the beginning of the Series collection and not the end? Essentially, I want to rewind the data. I am doing this now by shifting the data manually, but it is much slower than using InsertRowBackAndScoll to add data.


Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: SurfaceGridSeries3D InsertRowBackAndScroll Backwards

Post by ArctionKestutis » Mon Feb 18, 2019 11:35 am


LightningChart does not have method for inserting Row (optimal way) in front of surface data. However, I believe you could mimic backwards scrolling by using View3D.ZAxisSecondary3D.
First, you should make Axis visible and Reversed property should be set opposite to primary Axis:

Code: Select all

            _chart.View3D.ZAxisSecondary3D.Visible = true;
            _chart.View3D.ZAxisSecondary3D.Reversed = !_chart.View3D.ZAxisPrimary3D.Reversed;
Second, then shifting Surface data, secondary axis should be moved backwards relatively to some big value (lenght of recording):

Code: Select all

        private void SetNewDataToSurface(double[] data)
            //Surface grid series has optimized methods for adding data to back.
            SurfacePoint[,] surfaceData = _surface.Data;
            double minZ = _currentZ - (_chart.View3D.ZAxisPrimary3D.Maximum - _chart.View3D.ZAxisPrimary3D.Minimum);
            double maxZ = _currentZ;
            _surface.InsertRowBackAndScroll(data, minZ, maxZ, minZ, maxZ);

            minZ = 1000 - _currentZ - (_chart.View3D.ZAxisSecondary3D.Maximum - _chart.View3D.ZAxisSecondary3D.Minimum);
            maxZ = 1000 - _currentZ;
            _chart.View3D.ZAxisSecondary3D.SetRange(minZ, maxZ);
If you want 'correct' shift, you probably could create corresponding method in the source of LightningChart (I believe you are subscribe of the source code).

Hope this helps.