SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Answered
0
0

Hi,

I would like to ask whether it is possible to reduce the default margins around the 3D plane cube on 3D plots? I realize that I can change it by relocating the camera and with ZoomModifier but, once the ZoomExtents() is called, the margins are restored back. I attached here a screenshot with the green line showing the margin area that I mean.

Thank you in advance!

Version
6.1.1
Images
  • You must to post comments
Best Answer
0
0

Hi there

I know what you mean. ZoomExtents attempts to zoom to fit the scene into the camera and it uses a fairly simply algorithm hence why it can sometimes zoom out too far to ensure that all elements are visible.

What you can do is use a property on ZoomExtentsModifier3D called ResetPosition & ResetTarget. Specifying these lets you specify exactly where the camera moves to on double-click to Zoom Extents. There is also an AutoFitRadius property. For example:

    <s3D:SciChart3DSurface x:Name="sciChart3DSurface">
        <s3D:SciChart3DSurface.Camera>
            <s3D:Camera3D Target="0,50,0" Position="-400,200,400"></s3D:Camera3D>
        </s3D:SciChart3DSurface.Camera>
        <s3D:SciChart3DSurface.XAxis>
            <s3D:NumericAxis3D/>
        </s3D:SciChart3DSurface.XAxis>
        <s3D:SciChart3DSurface.YAxis>
            <s3D:NumericAxis3D/>
        </s3D:SciChart3DSurface.YAxis>
        <s3D:SciChart3DSurface.ZAxis>
            <s3D:NumericAxis3D/>
        </s3D:SciChart3DSurface.ZAxis>
        <s3D:SciChart3DSurface.ChartModifier>
            <s3D:ModifierGroup3D>
                <s3D:FreeLookModifier3D ExecuteOn="MouseLeftButton" ExecuteWhen="Shift"/>
                <s3D:OrbitModifier3D ExecuteOn="MouseLeftButton"/>
                <s3D:MouseWheelZoomModifier3D/> 
               <!-- This code will ensure camera is reset to -400,200,400 when you double click to zoom extents --> 
                <s3D:ZoomExtentsModifier3D ResetPosition="-400,200,400" ResetTarget="0,50,0" AutoFitRadius="False"  AnimateDurationMs="500"/>
            </s3D:ModifierGroup3D>
        </s3D:SciChart3DSurface.ChartModifier>
    </s3D:SciChart3DSurface>

Does this help?

Best regards,
Andrew

  • corvex
    Hi Andrew, Yes, this solution worked for me, thanks a lot.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.