Skip to main content

Chart3DControl.ContentTransform Property

Gets or sets the position, rotation angles and scale of the chart.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v23.2.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public Transform3D ContentTransform { get; set; }

Property Value

Type Description
Transform3D

The transform matrix that specifies the position, rotation angles and scale of the chart.

Remarks

The following example rotates, scales and translates a chart:

<dxc:Chart3DControl x:Name="chartControl">
    <dxc:Chart3DControl.ContentTransform>
        <Transform3DGroup>
            <Transform3DGroup.Children>
                <RotateTransform3D>
                    <RotateTransform3D.Rotation>
                        <AxisAngleRotation3D Axis="1,0,0" Angle="30" />
                    </RotateTransform3D.Rotation>
                </RotateTransform3D>
                <RotateTransform3D>
                    <RotateTransform3D.Rotation>
                        <AxisAngleRotation3D Axis="0,1,0" Angle="20" />
                    </RotateTransform3D.Rotation>
                </RotateTransform3D>
                <RotateTransform3D>
                    <RotateTransform3D.Rotation>
                        <AxisAngleRotation3D Axis="0,0,1" Angle="10" />
                    </RotateTransform3D.Rotation>
                </RotateTransform3D>
                <ScaleTransform3D ScaleX="1.5" ScaleY="0.8" ScaleZ="1" 
                                  CenterX="0" CenterY="0" CenterZ="0" />
                <TranslateTransform3D OffsetX="20" OffsetY="30" OffsetZ="80"/>
            </Transform3DGroup.Children>
        </Transform3DGroup>
    </dxc:Chart3DControl.ContentTransform>
    <!--...-->
</dxc:Chart3DControl>

The following code applies the same transformations as the markup above but at runtime:

using System.Windows.Media.Media3D;
//...
private void chartControl_Loaded(object sender, RoutedEventArgs e) {
    chartControl.ContentTransform = GetContentTransformation();
}

Transform3D GetContentTransformation() {
    Transform3DGroup transform = new Transform3DGroup();
    transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), 30)));
    transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 20)));
    transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), 10)));
    transform.Children.Add(new ScaleTransform3D { ScaleX = 1.5, ScaleY = 0.8, ScaleZ = 1,
                                                  CenterX = 0, CenterY = 0, CenterZ = 0 });
    transform.Children.Add(new TranslateTransform3D { OffsetX = 20, OffsetY = 30, OffsetZ = 80 });
    return transform;
}

For more information about 3D object transformations, see the topic: 3D Transformations Overview

See Also