Polar Line Chart
The Ignite UI for Angular polar area chart belongs to a group of polar charts and is rendered using a collection of straight lines connecting data points. The IgxPolarLineSeriesComponent uses the same concepts of data plotting as the IgxScatterLineSeriesComponent but wraps data points around a circle rather than stretching them along a horizontal line. Like with other series types, multiple IgxPolarLineSeriesComponent 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 Angular data chart component provides various types of axes but only the following types of axes can be used with IgxPolarLineSeriesComponent.
Required Data
The IgxPolarLineSeriesComponent 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
IgxPolarLineSeriesComponent. - All data items must contain at least two numeric data columns which should be mapped using the
angleMemberPathandradiusMemberPathproperties of theIgxPolarLineSeriesComponent.
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 (IgxNumericAngleAxisComponent) and the concentric rings that surround the pole are gridlines of the radius axis (IgxNumericRadiusAxisComponent)
You can use the SamplePolarData as data source which meets above data requirements.
this.dataSource = SamplePolarData.create();
Required Modules
Creation of the IgxPolarLineSeriesComponent requires the following modules:
// axis' modules:
import { IgxNumericAngleAxis } from "igniteui-angular-charts/ES5/igx-numeric-angle-axis";
import { IgxNumericRadiusAxis } from "igniteui-angular-charts/ES5/igx-numeric-radius-axis";
// series modules:
import { IgxPolarLineSeries } from "igniteui-angular-charts/ES5/igx-polar-line-series";
// data chart's modules:
import { IgxDataChartCoreModule } from "igniteui-angular-charts/ES5/igx-data-chart-core-module";
import { IgxDataChartPolarCoreModule } from "igniteui-angular-charts/ES5/igx-data-chart-polar-core-module";
import { IgxDataChartPolarModule } from "igniteui-angular-charts/ES5/igx-data-chart-polar-module";
// in app.module.ts file
@NgModule({
imports: [
// ...
IgxDataChartCoreModule,
IgxDataChartPolarCoreModule,
IgxDataChartPolarModule,
// ...
]
})
Code Example - Polar Line Series
This code demonstrates how to create an instance of the Ignite UI for Angular data chart with IgxPolarLineSeriesComponent and bind it to a data source.
<igx-data-chart
[dataSource]="dataSource"
width="700px"
height="500px">
<igx-numeric-angle-axis name="angleAxis" startAngleOffset="-90"></igx-numeric-angle-axis>
<igx-numeric-radius-axis name="radiusAxis"></igx-numeric-radius-axis>
<igx-polar-line-series
name="series1"
angleMemberPath="Direction"
radiusMemberPath="WindSpeed"
radiusAxisName="radiusAxis"
angleAxisName="angleAxis">
</igx-polar-line-series>
</igx-data-chart>