React Polar Series

This topic explains various types of polar series in the React data chart component. Polar series is a group of series that use the polar (angle, radius) coordinate system instead of the Cartesian (x, y) coordinate system to plot data in chart. In other words, polar series take concepts of Scatter Series and wrap them around a circle rather than stretching along a horizontal line. This group of series is used to show the relationship among the items in several distinct series of data using the polar coordinates system.

Polar series draw attention to uneven intervals or clusters of data. They are often used to plot scientific data (e.g. wind's direction and speed, strength and direction of magnetic field, location of objects in solar system), and can highlight the deviation of collected data from predicted results.

React Polar Series Example

Edit on CodeSandbox

Types of Polar Series

The Data Chart supports the following types of polar series:

Series Name Description
IgrPolarAreaSeries Displays a filled polygon enclosed by a collection of straight lines connecting data points which are located at the polar (angle/radius) coordinates
IgrPolarSplineAreaSeries Displays a filled polygon enclosed by a collection of smooth/interpolated lines connecting data points which are located at the polar (angle/radius) coordinates
IgrPolarSplineSeries Displays a collection of smooth/interpolated lines connecting data points which are located at the polar (angle/radius) coordinates
IgrPolarScatterSeries Displays a collection of markers representing data points which are located at the polar (angle/radius) coordinates
IgrPolarLineSeries Displays a collection of straight lines connecting data points which are located at the polar (angle/radius) coordinates

Required Axes

The React data chart component provides various types of axes but only the following types of axes can be used with polar series.

Series Type Radius Axis Type Angle Axis Type
IgrPolarAreaSeries IgrNumericRadiusAxis IgrNumericAngleAxis
IgrPolarSplineAreaSeries IgrNumericRadiusAxis IgrNumericAngleAxis
IgrPolarSplineSeries IgrNumericRadiusAxis IgrNumericAngleAxis
IgrPolarScatterSeries IgrNumericRadiusAxis IgrNumericAngleAxis
IgrPolarLineSeries IgrNumericRadiusAxis IgrNumericAngleAxis

Required Data

Polar series have the following data requirements:

  • The data source must be an array or a list of data items
  • The data source must contain at least one data item otherwise the chart will not render the polar series.
  • All data items must contain at least two numeric data columns which should be mapped using the angleMemberPath and radiusMemberPath properties of polar series (e.g. IgrPolarAreaSeries)

In polar coordinate systems, the location of data points is determined by an angle (angular coordinate) from a fixed direction and distance (radial coordinate) from a fixed point (analogous to the origin of a Cartesian coordinate) which is called "the pole". The lines that start from the pole and point outwards are gridlines of the angular axis (IgrNumericAngleAxis) and the concentric rings that surround the pole are gridlines of the radius axis (IgrNumericRadiusAxis)

You can use the SamplePolarData as data source which meets above data requirements.

public dataSource: any[] = SamplePolarData.create();

Required Modules

The polar series requires the following modules:

// axis' modules:
import { IgrNumericAngleAxis } from 'igniteui-react-charts';
import { IgrNumericRadiusAxis } from 'igniteui-react-charts';
// series modules:
import { IgrPolarAreaSeries } from 'igniteui-react-charts';
import { IgrPolarLineSeries } from 'igniteui-react-charts';
import { IgrPolarSplineSeries } from 'igniteui-react-charts';
import { IgrPolarSplineAreaSeries } from 'igniteui-react-charts';
import { IgrPolarScatterSeries } from 'igniteui-react-charts';
// data chart's modules:
import { IgrDataChart } from 'igniteui-react-charts';
import { IgrDataChartCoreModule } from 'igniteui-react-charts';
import { IgrDataChartPolarCoreModule } from 'igniteui-react-charts';
import { IgrDataChartPolarModule } from 'igniteui-react-charts';

// registering data chart's modules:
IgrDataChartCoreModule.register();
IgrDataChartPolarCoreModule.register();
IgrDataChartPolarModule.register();

Code Example

This code demonstrates how to create an instance of data chart with IgrPolarLineSeries and bind it to the data source.

<IgrDataChart
    dataSource={this.state.dataSource}
    width="700px"
    height="500px">
    <IgrNumericAngleAxis  name="angleAxis" startAngleOffset={-90} />
    <IgrNumericRadiusAxis name="radiusAxis" />
    <IgrPolarLineSeries
        name="series1"
        angleMemberPath="Direction"
        radiusMemberPath="WindSpeed"
        radiusAxisName="radiusAxis"
        angleAxisName="angleAxis" />
</IgrDataChart>
const series1 = new IgrPolarLineSeries({ name: "series1" });
series1.angleMemberPath = "Direction";
series1.radiusMemberPath  = "WindSpeed";
series1.radiusAxisName = "radiusAxis";
series1.angleAxisName = "angleAxis";

const radiusAxis = new IgrNumericRadiusAxis({ name: "radiusAxis" });
const angleAxis = new IgrNumericAngleAxis({ name: "angleAxis" });

this.chart = new IgrDataChart({ name: "chart" });
this.chart.dataSource = SampleCategoryData.create();
this.chart.axes.add(radiusAxis);
this.chart.axes.add(angleAxis);
this.chart.series.add(series1);

Note that you can also use above code to create other type of polar series by replacing IgrPolarLineSeries with name of polar series that you want to render.

Additional Resources