Polar Scatter Chart
The Ignite UI for Web Components 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 IgcPolarScatterSeriesComponent uses the same concepts of data plotting as the IgcScatterSeriesComponent but wraps data points around a circle rather than stretching them along a horizontal line. Like with other series types, multiple IgcPolarScatterSeriesComponent 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 Web Components data chart component provides various types of axes but only the following types of axes can be used with IgcPolarScatterSeriesComponent.
Required Data
The IgcPolarScatterSeriesComponent 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
IgcPolarScatterSeriesComponent. - All data items must contain at least two numeric data columns which should be mapped using the
angleMemberPathandradiusMemberPathproperties of theIgcPolarScatterSeriesComponent.
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 (IgcNumericAngleAxisComponent) and the concentric rings that surround the pole are gridlines of the radius axis (IgcNumericRadiusAxisComponent)
You can use the SamplePolarData as data source which meets above data requirements.
public dataSource: any[] = SamplePolarData.create();
Required Modules
Creation of the IgcPolarScatterSeriesComponent requires the following modules:
// Module Manager:
import { ModuleManager } from 'igniteui-webcomponents-core';
// data chart's modules:
import { IgcDataChartCoreModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartInteractivityModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartPolarCoreModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartPolarModule } from 'igniteui-webcomponents-charts';
// axis' modules:
import { IgcNumericAngleAxisModule } from 'igniteui-webcomponents-charts';
import { IgcNumericRadiusAxisModule } from 'igniteui-webcomponents-charts';
// axis' components
import { IgcNumericAngleAxisComponent } from 'igniteui-webcomponents-charts';
import { IgcNumericRadiusAxisComponent } from 'igniteui-webcomponents-charts';
// series modules:
import { IgcPolarScatterSeriesModule } from 'igniteui-webcomponents-charts';
// series' components
import { IgcPolarScatterSeriesComponent } from 'igniteui-webcomponents-charts';
// data chart component
import { IgcDataChartComponent } from 'igniteui-webcomponents-charts';
// register the modules
ModuleManager.register(
IgcDataChartCoreModule,
IgcDataChartInteractivityModule,
IgcDataChartPolarCoreModule,
IgcDataChartPolarModule,
IgcPolarScatterSeriesModule
);
Code Example
This code demonstrates how to create an instance of the Ignite UI for Web Components data chart with IgcPolarScatterSeriesComponent and bind it to a data source.
<igc-data-chart id="chart"
width="700px"
height="500px">
<igc-numeric-angle-axis id="angleAxis" start-angle-offset="-90"></igc-numeric-angle-axis>
<igc-numeric-radius-axis id="radiusAxis"></igc-numeric-radius-axis>
<igc-polar-line-series
id="series1"
angle-axis="angleAxis"
radius-axis="radiusAxis"
angle-member-path="Direction"
radius-member-path="WindSpeed">
</igc-polar-line-series>
</igc-data-chart>
let chart = (document.getElementById("chart") as IgcDataChartComponent);
chart.dataSource = data;