Polar Area Chart

The Ignite UI for React polar area chart belongs to a group of polar charts and has a shape of a filled polygon which vertices or corners are located at the polar (angle/radius) coordinates of data points. The IgrPolarAreaSeries uses the same concepts of data plotting as the IgrScatterSeries but wraps data points around a circle rather than stretching them along a horizontal line. Like with other series types, multiple IgrPolarAreaSeries can be plotted in the same data chart and they can be overlaid on each other to show differences and similarities between data sets.

Demo

Required Axes

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

Required Data

The IgrPolarAreaSeries has 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 IgrPolarAreaSeries.
  • All data items must contain at least two numeric data columns which should be mapped using the angleMemberPath and radiusMemberPath properties of the 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

Creation of the IgrPolarAreaSeries 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';
// 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 the Ignite UI for React data chart with IgrPolarAreaSeries and bind it to a data source.

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

Additional Resources