Back to Devexpress

Polar Line Chart

windowsforms-3318-controls-and-libraries-chart-control-series-views-2d-series-views-polar-series-views-polar-line-chart.md

latest4.8 KB
Original Source

Polar Line Chart

  • Sep 29, 2023
  • 3 minutes to read

Short Description

The Polar Line Chart is represented by the PolarLineSeriesView object, which belongs to Polar Series Views. This view is useful when it’s necessary to show trends for several series and compare their values for the same points arguments on a circular diagram on the basis of angles. Note that although these charts normally have a circular shape, they can also be displayed as a polygon. This is controlled via the RadarDiagram.DrawingStyle property.

A Polar Line chart is shown in the image below.

Chart Type Characteristics

The table below lists the main characteristics of this chart type.

FeatureValue
Series View typePolarLineSeriesView
Diagram typePolarDiagram
Number of arguments per series point1
Number of values per series point1

Note

For information on which chart types can be combined with the Polar Line Chart , refer to the Series Views Compatibility document.

Example

The following example demonstrates how to create a ChartControl with a series of the PolarLineSeriesView 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 polarLineChart = new ChartControl();

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

    // Populate the series with points.
    series1.Points.Add(new SeriesPoint(0, 90));
    series1.Points.Add(new SeriesPoint(90, 70));
    series1.Points.Add(new SeriesPoint(180, 50));
    series1.Points.Add(new SeriesPoint(270, 100));

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

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

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

    // Add the chart to the form.
    polarLineChart.Dock = DockStyle.Fill;
    this.Controls.Add(polarLineChart);
}
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 polarLineChart As New ChartControl()

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

    ' Populate the series with points.
    series1.Points.Add(New SeriesPoint(0, 90))
    series1.Points.Add(New SeriesPoint(90, 70))
    series1.Points.Add(New SeriesPoint(180, 50))
    series1.Points.Add(New SeriesPoint(270, 100))

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

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

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

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

See Also

Radar and Polar Diagrams