Page 1 of 1

Zoom to Extents?

Posted: Mon May 30, 2016 11:57 am
by Greg9504
Hello,

Is there a quick way to tell Lightning Chart to "Zoom to extents"?
Zoom to extents definition
Zoom to extents definition
autodeskzoomtoextents.png (35.75 KiB) Viewed 6341 times
The app allows the user to switch between default perspective view
m_chart.View3D.Camera.SetPredefinedCamera(PredefinedCamera.Default);
Default View
Default View
perspectiveview.jpg (224.24 KiB) Viewed 6341 times
and top 2D view
m_chart.View3D.Camera.SetPredefinedCamera(PredefinedCamera.TopOrthographicZX);
Default TopOrthographicZX view
Default TopOrthographicZX view
orthogonalviewdefault.jpg (162.95 KiB) Viewed 6341 times
what I would like to do is have it zoom to extents on switching, so it looks like this:
... continued in next post due to image attachment restriction...

Re: Zoom to Extents?

Posted: Mon May 30, 2016 11:59 am
by Greg9504
desired zoomed 2D view:
TopOrthographicZX zoomed to extent
TopOrthographicZX zoomed to extent
orthogonalviewzoomtoextent.jpg (193.25 KiB) Viewed 6340 times

Re: Zoom to Extents?

Posted: Fri Jun 03, 2016 8:19 am
by ArctionPasi
To fit the axis ranges to contents of series, you can do that like this:

Code: Select all

 m_chart.BeginUpdate(); 

            m_chart.View3D.SurfaceGridSeries3D[0].IncludeInAutoFit = true;
            PointDouble3D p1, p2;
            m_chart.View3D.ZoomPanOptions.GetAutoFitRange(out p1, out p2);
            m_chart.View3D.XAxisPrimary3D.SetRange(p1.X, p2.X); 
            m_chart.View3D.YAxisPrimary3D.SetRange(p1.Y, p2.Y);
            m_chart.View3D.ZAxisPrimary3D.SetRange(p1.Z, p2.Z);

            m_chart.EndUpdate();
            
:)
IncludeInAutoFit is per series. With that you pick the series you want to count in the fitting.