Scatter Polar Line Chart

  • 7 minutes to read

The Scatter Polar Line chart uses the ScatterPolarLineSeriesView to visualize data. The Chart Control displays series points in the same order they were added to the collection without aggregation by arguments.

The following image shows a Scatter Polar Line Chart (the Archimedean spiral):

ScatterPolarLine

Run Demo: Polar Views

Chart Type Characteristics

The table below lists the main Scatter Polar Line chart characteristics:

Feature Value
Series View type ScatterPolarLineSeriesView
Diagram type 2D-PolarDiagram
Number of arguments per series point 1
Number of values per series point 1
NOTE
  • For information on which chart types can be combined with the Scatter Polar Line chart, refer to the Series Views Compatibility document.
  • The axis scale types should be numeric continuous to display data correctly.

Create a Scatter Polar Line Chart at Runtime

Add Points Manually

The following example creates a Scatter Polar Line Chart at runtime:

View Example: How to create a scatter polar line chart at runtime

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

namespace ScatterPolarLine {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

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

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

            // Create a scatter polar line series.
            Series series1 = new Series("Series 1", ViewType.ScatterPolarLine);

            // Add points to it.
            series1.Points.Add(new SeriesPoint(0, 0.523598));
            series1.Points.Add(new SeriesPoint(30, 0.523598));
            series1.Points.Add(new SeriesPoint(60, 1.047197));
            series1.Points.Add(new SeriesPoint(90, 1.570796));
            series1.Points.Add(new SeriesPoint(120, 2.094395));
            series1.Points.Add(new SeriesPoint(150, 2.617993));
            series1.Points.Add(new SeriesPoint(180, 3.141592));
            series1.Points.Add(new SeriesPoint(210, 3.665191));
            series1.Points.Add(new SeriesPoint(240, 4.188790));
            series1.Points.Add(new SeriesPoint(270, 4.712388));
            series1.Points.Add(new SeriesPoint(300, 5.235987));
            series1.Points.Add(new SeriesPoint(330, 5.759586));
            series1.Points.Add(new SeriesPoint(0, 6.283185));
            series1.Points.Add(new SeriesPoint(30, 6.806784));
            series1.Points.Add(new SeriesPoint(60, 7.330382));
            series1.Points.Add(new SeriesPoint(90, 7.853981));
            series1.Points.Add(new SeriesPoint(120, 8.377580));
            series1.Points.Add(new SeriesPoint(150, 8.901179));
            series1.Points.Add(new SeriesPoint(180, 9.424777));
            series1.Points.Add(new SeriesPoint(210, 9.948376));
            series1.Points.Add(new SeriesPoint(240, 10.4719755));
            series1.Points.Add(new SeriesPoint(270, 10.9955742));
            series1.Points.Add(new SeriesPoint(300, 11.5191730));
            series1.Points.Add(new SeriesPoint(330, 12.04277183));
            series1.Points.Add(new SeriesPoint(0, 12.56637061));

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

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

            // Hide the legend (if necessary).
            scatterPolarLineChart.Legend.Visibility = DefaultBoolean.False;

            // Add a title to the chart (if necessary).
            scatterPolarLineChart.Titles.Add(new ChartTitle());
            scatterPolarLineChart.Titles[0].Text = "A Scatter Polar Line Chart";
        }
    }
}

Result:

Scatter Polar Line Chart

Bind a Chart to a Data Source

The following example binds a Scatter Polar Line Chart to a data table:

View Example: How to bind a scatter polar line chart to a data source

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

    // Add the chart to the form.
    scatterPolarLineChart.Dock = DockStyle.Fill;
    this.Controls.Add(scatterPolarLineChart);
    scatterPolarLineChart.DataSource = CreateChartData();

    // Create a scatter polar line series.
    Series series = new Series("Series 1", ViewType.ScatterPolarLine);
    series.ArgumentDataMember = "Angle";
    series.ValueDataMembers.AddRange(new string[] { "Distance" });
    scatterPolarLineChart.Series.Add(series);
    ScatterPolarLineSeriesView view = (ScatterPolarLineSeriesView)series.View;

    // Hide markers.
    view.MarkerVisibility = DefaultBoolean.False;
    // Hide the line that connects the first and last point.
    view.Closed = false;

    // Hide the legend.
    scatterPolarLineChart.Legend.Visibility = DefaultBoolean.False;

    // Add a title to the chart.
    scatterPolarLineChart.Titles.Add(new ChartTitle());
    scatterPolarLineChart.Titles[0].Text = "Archimedean Spiral";
}

private DataTable CreateChartData() {
    DataTable table = new DataTable("Table1");
    table.Columns.Add("Angle", typeof(double));
    table.Columns.Add("Distance", typeof(double));

    double minAngle = 0;
    double maxAngle = 720;
    int intervalsCount = 72;
    double angleStep = (maxAngle - minAngle) / (double)intervalsCount;
    for (int pointIndex = 0; pointIndex <= intervalsCount; pointIndex++) {
        double angle = minAngle + pointIndex * angleStep;
        double angleRadians = angle * Math.PI / 180.0;
        double distance = angleRadians;
        double normalizeAngle = angle % 360;
        table.Rows.Add(new object[] { normalizeAngle, distance });
    }
    return table;
}

Result:

ScatterPolarLine

Change Chart Appearance

The ScatterPolarLineSeriesView class exposes the following appearance settings for the Scatter Polar Line chart:

The code below changes the marker border color, line color and thickness, and displays the line shadow:

Scatter Polar Line Chart

using DevExpress.Utils;
using System.Drawing;
//...
ScatterPolarLineSeriesView view = (ScatterPolarLineSeriesView)series1.View;
view.LineMarkerOptions.BorderColor = Color.DarkBlue;
view.LineStyle.Thickness = 3;
view.Color = Color.CornflowerBlue;
view.Shadow.Color = Color.LightGray;
view.Shadow.Visible = true;
view.Closed = false;
TIP

You can use tooltips to show additional information when a user hovers a series point. Note the Chart Control does not display Crosshair Cursor for polar and radar series.

See Also