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



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!

  • You must to post comments
Best Answer

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:Camera3D Target="0,50,0" Position="-400,200,400"></s3D:Camera3D>
                <s3D:FreeLookModifier3D ExecuteOn="MouseLeftButton" ExecuteWhen="Shift"/>
                <s3D:OrbitModifier3D ExecuteOn="MouseLeftButton"/>
               <!-- 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"/>

Does this help?

Best regards,

  • 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.