Back to Devexpress

3D XY Diagram

wpf-115313-controls-and-libraries-charts-suite-chart-control-diagram-3d-xy-diagram.md

latest9.0 KB
Original Source

3D XY Diagram

  • May 28, 2021
  • 4 minutes to read

The 3D XY Diagram displays Cartesian series in a high-resolution 3D view. Refer to the 2D XY Diagram document to learn more about its 2D counterpart.

This topic includes the following sections:

Compatible Series

The diagram can only display the following compatible series:

Refer to the Series Type Compatibility document for more information.

How to Create a Chart with a 3D XY Diagram

The markup below shows how to create a chart with a 3D XY Diagram:

xaml
<dxc:ChartControl>
    <dxc:ChartControl.Titles>
        <dxc:Title Content="3D XY Diagram"/>
    </dxc:ChartControl.Titles>
    <dxc:ChartControl.Legends>
        <dxc:Legend/> 
    </dxc:ChartControl.Legends>
    <!-- The 3D XY diagram's settings. -->
    <dxc:XYDiagram3D HeightToWidthRatio="0.3" 
                     PlaneDepthFixed="30">
        <!-- The x-axis settings. -->
        <dxc:XYDiagram3D.AxisX>
            <dxc:AxisX3D/>
        </dxc:XYDiagram3D.AxisX>
        <!-- The y-axis settings. -->
        <dxc:XYDiagram3D.AxisY>
            <dxc:AxisY3D/>
        </dxc:XYDiagram3D.AxisY>
        <!-- The first Side-by-Side 3D Bar series settings. -->
        <dxc:BarSideBySideSeries3D DisplayName="Series 1">
            <dxc:SeriesPoint Argument="1" Value="10.5"/>
            <dxc:SeriesPoint Argument="2" Value="12"/>
        </dxc:BarSideBySideSeries3D>
        <!-- The second Side-by-Side 3D Bar series settings. -->
        <dxc:BarSideBySideSeries3D DisplayName="Series 2">
            <dxc:SeriesPoint Argument="1" Value="9"/>
            <dxc:SeriesPoint Argument="2" Value="11"/>
        </dxc:BarSideBySideSeries3D>
    </dxc:XYDiagram3D>
</dxc:ChartControl>

The following table lists all the classes and properties that the markup above uses:

Class or PropertyDescription
ChartControlThe Chart Control.
ChartControlBase.TitlesThe Chart’s title collection.
TitleAn individual title.
TitleBase.ContentSpecifies title content.
ChartControlBase.LegendsThe Chart’s legend collection.
LegendA legend.
XYDiagram3DThe 3D XY diagram.
XYDiagram3D.HeightToWidthRatioSpecifies the diagram’s height to width ratio as a percentage.
XYDiagram3D.PlaneDepthFixedSpecifies coordinate planes’ depth (thickness).
XYDiagram3D.AxisXStores diagram x-axis settings.
AxisX3DThe 3D XY diagram’s x-axis.
XYDiagram3D.AxisYStores a diagram’s y-axis settings.
AxisY3DThe 3D XY diagram’s y-axis.
BarSideBySideSeries3DThe 3D Side-by-Side Bar series.
Series.DisplayNameSpecifies a series’s display name.
SeriesPointA series point.
SeriesPoint.ArgumentThe series point’s argument.
SeriesPoint.ValueThe series point’s value.

You can also access a 3D XY diagram’s options at runtime as shown below:

csharp
// Cast Diagram to the XYDiagram3D type. 
XYDiagram3D diagram = chart.Diagram as XYDiagram3D;
if (diagram != null) {
    // Access to the diagram's options. 
    diagram.RuntimeRotation = true;
}
vb
' Cast Diagram to the XYDiagram3D type.
Dim diagram As XYDiagram3D = TryCast(chart.Diagram, XYDiagram3D)
If diagram IsNot Nothing Then
    ' Access to the diagram's options.  
    diagram.RuntimeRotation = True
End If

3D XY Diagram’s Specific Options

Below is a list of 3D XY Diagram-specific properties:

Note

Diagram pixels is a measurement unit that was introduced specially for 3D diagrams to meet their unique requirements.

The following list details specific properties for a 3D Diagram:

Zooming and Scrolling

The Diagram3D.HorizontalScrollPercent and Diagram3D.VerticalScrollPercent properties determine the distance the chart can move in relation to the central position within a diagram as a diagram width percentage. These properties can be specified using positive or negative values. If the ScrollPercent properties specify values that are too large, the series inside the diagram may be moved outside. Use the Diagram3D.RuntimeScrolling property to provide end users with scrolling capabilities at runtime.

The Diagram3D.ZoomPercent property specifies a chart magnification value. This value should be between 1 and 500 percents and is equal to 100 by default. Use the Diagram3D.RuntimeZooming property to enable zooming at runtime.

Refer to Zooming and Scrolling (3D Charts) for more information.

Perspective

In a perspective projection, the lines that are parallel to the object converge as they move towards a horizon line on the projection surface. The rate at which parallel lines converge is called the perspective angle. Use the Diagram3D.PerspectiveAngle property to specify a perspective angle for a 3D diagram in a perspective projection. The Perspective Angle may be equal to or more than 0 , and must be less than 180.

Rotation

Use the Diagram3D.RuntimeRotation property to allow chart rotation at runtime.

3D charts can be rotated using the Ctrl+mouse pointer (design time) or mouse pointer only (runtime).

Refer to Rotation (3D Charts) for more details.

See Also

2D XY Diagram

3D Series Types

Chart3D Control