Zoom to Extents?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

Greg9504
Posts: 38
Joined: Fri Dec 06, 2013 4:51 pm

Zoom to Extents?

Post by Greg9504 » Mon May 30, 2016 11:57 am

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 5162 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 5162 times
and top 2D view
m_chart.View3D.Camera.SetPredefinedCamera(PredefinedCamera.TopOrthographicZX);
Default TopOrthographicZX view
Default TopOrthographicZX view
orthogonalviewdefault.jpg (162.95 KiB) Viewed 5162 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...

Greg9504
Posts: 38
Joined: Fri Dec 06, 2013 4:51 pm

Re: Zoom to Extents?

Post by Greg9504 » Mon May 30, 2016 11:59 am

desired zoomed 2D view:
TopOrthographicZX zoomed to extent
TopOrthographicZX zoomed to extent
orthogonalviewzoomtoextent.jpg (193.25 KiB) Viewed 5161 times

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Zoom to Extents?

Post by ArctionPasi » Fri Jun 03, 2016 8:19 am

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.
LightningChart Support Team, PT