Back to Devexpress

RadarDiagram.RotationDirection Property

corelibraries-devexpress-dot-xtracharts-dot-radardiagram-1fdb1ffd.md

latest5.5 KB
Original Source

RadarDiagram.RotationDirection Property

Gets or sets the direction in which the RadarAxisX is drawn.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Appearance)]
public RadarDiagramRotationDirection RotationDirection { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Appearance)>
Public Property RotationDirection As RadarDiagramRotationDirection

Property Value

TypeDescription
RadarDiagramRotationDirection

A RadarDiagramRotationDirection enumeration member specifying the AxisX rotation direction.

|

Available values:

NameDescription
Counterclockwise

A diagram is rotated counterclockwise.

| | Clockwise |

A diagram is rotated clockwise.

|

Remarks

The following images demonstrate the RotationDirection property in action.

RotationDirection = ClockwiseRotationDirection = Counterclockwise

Example

The following example demonstrates how to create a ChartControl with a series of the RadarAreaSeriesView 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.

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

private void Form1_Load(object sender, EventArgs e) {
    // Create a new chart.
    ChartControl RadarAreaChart = new ChartControl();

    // Add a radar series to it.
    Series series1 = new Series("Series 1", ViewType.RadarArea);

    // Populate the series with points.
    series1.Points.Add(new SeriesPoint(0, 90));
    series1.Points.Add(new SeriesPoint(90, 95));
    series1.Points.Add(new SeriesPoint(180, 50));
    series1.Points.Add(new SeriesPoint(270, 55));
    series1.Points.Add(new SeriesPoint(0, 180));
    series1.Points.Add(new SeriesPoint(90, 185));
    series1.Points.Add(new SeriesPoint(180, 270));
    series1.Points.Add(new SeriesPoint(270, 275));

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

    // Flip the diagram (if necessary).
    ((RadarDiagram)RadarAreaChart.Diagram).StartAngleInDegrees = 180;
    ((RadarDiagram)RadarAreaChart.Diagram).RotationDirection =
        RadarDiagramRotationDirection.Counterclockwise;

    // Add a title to the chart and hide the legend.
    ChartTitle chartTitle1 = new ChartTitle();
    chartTitle1.Text = "Radar Area Chart";
    RadarAreaChart.Titles.Add(chartTitle1);
    RadarAreaChart.Legend.Visible = false;

    // Add the chart to the form.
    RadarAreaChart.Dock = DockStyle.Fill;
    this.Controls.Add(RadarAreaChart);
}
vb
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraCharts
' ...

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
    ' Create a new chart.
    Dim RadarAreaChart As New ChartControl()

    ' Add a radar series to it.
    Dim series1 As New Series("Series 1", ViewType.RadarArea)

    ' Populate the series with points.
    series1.Points.Add(New SeriesPoint(0, 90))
    series1.Points.Add(New SeriesPoint(90, 95))
    series1.Points.Add(New SeriesPoint(180, 50))
    series1.Points.Add(New SeriesPoint(270, 55))
    series1.Points.Add(New SeriesPoint(0, 180))
    series1.Points.Add(New SeriesPoint(90, 185))
    series1.Points.Add(New SeriesPoint(180, 270))
    series1.Points.Add(New SeriesPoint(270, 275))

    ' Add the series to the chart.
    RadarAreaChart.Series.Add(series1)

    ' Flip the diagram (if necessary).
    CType(RadarAreaChart.Diagram, RadarDiagram).StartAngleInDegrees = 180
    CType(RadarAreaChart.Diagram, RadarDiagram).RotationDirection = _ 
        RadarDiagramRotationDirection.Counterclockwise

    ' Add a title to the chart and hide the legend.
    Dim chartTitle1 As New ChartTitle()
    chartTitle1.Text = "Radar Area Chart"
    RadarAreaChart.Titles.Add(chartTitle1)
    RadarAreaChart.Legend.Visible = False

    ' Add the chart to the form.
    RadarAreaChart.Dock = DockStyle.Fill
    Me.Controls.Add(RadarAreaChart)
End Sub

See Also

StartAngleInDegrees

RadarDiagram Class

RadarDiagram Members

DevExpress.XtraCharts Namespace