Skip to main content

Diagram3D.RotationAngleX Property

Gets or sets the value (in degrees) at which the diagram should be rotated around the X-axis.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.dll

NuGet Package: DevExpress.Charts

Declaration

[NonTestableProperty]
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
[XtraSerializableProperty]
public int RotationAngleX { get; set; }

Property Value

Type Description
Int32

An integer value which specifies the rotation angle (in degrees).

Remarks

Note that the RotationAngleX property can be used only if the Diagram3D.RotationType property is set to either RotationType.UseAngles or RotationType.UseMouseStandard. If the Diagram3D.RotationType property is set to RotationType.UseMouseAdvanced, then the RotationAngleX property value is undefined and can’t be used.

Example

The following example demonstrates how to create a ChartControl with a series of the Pie3DSeriesView type, set its general properties, and add this chart to a form at runtime. Before proceeding with this example, first create a Windows Forms Application in Visual Studio, and include all necessary assemblies to the References list of your project.

Then, add the following code to the Form.Load event handler.

using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ...

private void Form1_Load(object sender, EventArgs e) {
    // Create an empty chart.
    ChartControl PieChart3D = new ChartControl();

    // Create a pie series.
    Series series1 = new Series("Pie Series 1", ViewType.Pie3D);

    // Populate the series with points.
    series1.Points.Add(new SeriesPoint("Russia", 17.0752));
    series1.Points.Add(new SeriesPoint("Canada", 9.98467));
    series1.Points.Add(new SeriesPoint("USA", 9.63142));
    series1.Points.Add(new SeriesPoint("China", 9.59696));
    series1.Points.Add(new SeriesPoint("Brazil", 8.511965));
    series1.Points.Add(new SeriesPoint("Australia", 7.68685));
    series1.Points.Add(new SeriesPoint("India", 3.28759));
    series1.Points.Add(new SeriesPoint("Others", 81.2));

    // Add the series to the chart.
    PieChart3D.Series.Add(series1);

    // Adjust the value numeric options of the series.
    series1.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
    series1.PointOptions.ValueNumericOptions.Precision = 0;

    // Adjust the view-type-specific options of the series.
    ((Pie3DSeriesView)series1.View).Depth = 30;
    ((Pie3DSeriesView)series1.View).ExplodedPoints.Add(series1.Points[0]);
    ((Pie3DSeriesView)series1.View).ExplodedDistancePercentage = 30;

    // Access the diagram's options.
    ((SimpleDiagram3D)PieChart3D.Diagram).RotationType = RotationType.UseAngles;
    ((SimpleDiagram3D)PieChart3D.Diagram).RotationAngleX = -35;

    // Add a title to the chart and hide the legend.
    ChartTitle chartTitle1 = new ChartTitle();
    chartTitle1.Text = "3D Pie Chart";
    PieChart3D.Titles.Add(chartTitle1);
    PieChart3D.Legend.Visible = false;

    // Add the chart to the form.
    PieChart3D.Dock = DockStyle.Fill;
    this.Controls.Add(PieChart3D);
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RotationAngleX property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also