Polar Scatter Chart
The Ignite UI for Angular polar scatter chart belongs to a group of polar charts and is rendered using markers at the locations of data points without connecting lines. The IgxPolarScatterSeriesComponent uses the same concepts of data plotting as the IgxScatterSeriesComponent but wraps data points around a circle rather than stretching them along a horizontal line. Like with other series types, multiple IgxPolarScatterSeriesComponent can be plotted in the same data chart and they can overlay 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 IgxPolarScatterSeriesComponent.
Required Data
The IgxPolarScatterSeriesComponent 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
IgxPolarScatterSeriesComponent. - All data items must contain at least two numeric data columns which should be mapped using the
angleMemberPathandradiusMemberPathproperties of theIgxPolarScatterSeriesComponent.
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.chart.dataSource = SamplePolarData.create();
Required Modules
Creation of the IgxPolarScatterSeriesComponent 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 { IgxPolarScatterSeries } from "igniteui-angular-charts/ES5/igx-polar-scatter-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 Scatter Chart
This code demonstrates how to create an instance of the Ignite UI for Angular data chart with IgxPolarScatterSeriesComponent 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-scatter-series
name="series1"
angleMemberPath="Direction"
radiusMemberPath="WindSpeed"
radiusAxisName="radiusAxis"
angleAxisName="angleAxis">
</igx-polar-scatter-series>
</igx-data-chart>