Polar Spline Chart
The Ignite UI for React polar spline chart belongs to a group of polar charts and is rendered using a collection of spline lines connecting data points in polar (angle/radius) coordinate system. The IgrPolarSplineSeries uses the same concepts of data plotting as the IgrScatterSplineSeries but wraps data points around a circle rather than stretching them along a horizontal line. Like with other series types, multiple IgrPolarSplineSeries 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 IgrPolarSplineSeries.
Required Data
The IgrPolarSplineSeries 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
IgrPolarSplineSeries. - All data items must contain at least two numeric data columns which should be mapped using the
angleMemberPathandradiusMemberPathproperties of theIgrPolarSplineSeries.
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 IgrPolarSplineSeries requires the following modules:
// axis' modules:
import { IgrNumericAngleAxis } from 'igniteui-react-charts';
import { IgrNumericRadiusAxis } from 'igniteui-react-charts';
// series modules:
import { IgrPolarSplineSeries } 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 IgrPolarSplineSeries and bind it to a data source.
<IgrDataChart
dataSource={this.dataSource}
width="700px"
height="500px">
<IgrNumericAngleAxis name="angleAxis" startAngleOffset={-90} />
<IgrNumericRadiusAxis name="radiusAxis" />
<IgrPolarSplineSeries
name="series1"
angleMemberPath="Direction"
radiusMemberPath="WindSpeed"
radiusAxisName="radiusAxis"
angleAxisName="angleAxis" />
</IgrDataChart>
const series1 = new IgrPolarSplineSeries({ 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 = SamplePolarData.create();
this.chart.axes.add(radiusAxis);
this.chart.axes.add(angleAxis);
this.chart.series.add(series1);