Radial Pie Chart
The Ignite UI for Angular radial pie chart belongs to a group of radial charts and uses pie slices that extend from the center of chart towards locations of data points. The IgxRadialPieSeriesComponent take concepts of categorizing multiple series of data points and wrapping them around on a circle rather than stretching data points along a horizontal line.
Demo
Required Axes
The Angular data chart component provides various types of axes but only the following types of axes can be used with IgxRadialPieSeriesComponent.
Required Data
The IgxRadialPieSeriesComponent 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
IgxRadialPieSeriesComponent. - All data items must contain at least one label data column (string or date time) which should be mapped to the
Labelproperty of the category axis (e.g.IgxCategoryAngleAxisComponent). - All data items must contain at least one numeric data column which should be mapped using the
valueMemberPathproperty of theIgxRadialPieSeriesComponent.
You can use the SampleRadialData as data source which meets above data requirements.
this.chart.dataSource = SampleRadialData.create();
Required Modules
Creation of the IgxRadialPieSeriesComponent requires the following modules:
// axis' modules:
import { IgxCategoryAngleAxis } from "igniteui-angular-charts/ES5/igx-category-angle-axis";
import { IgxNumericRadiusAxis } from "igniteui-angular-charts/ES5/igx-numeric-radius-axis";
// series modules:
import { IgxRadialPieSeries } from "igniteui-angular-charts/ES5/igx-radial-pie-series";
// data chart's modules:
import { IgxDataChartCoreModule } from "igniteui-angular-charts/ES5/igx-data-chart-core-module";
import { IgxDataChartRadialCoreModule } from "igniteui-angular-charts/ES5/igx-data-chart-radial-core-module";
import { IgxDataChartRadialModule } from "igniteui-angular-charts/ES5/igx-data-chart-radial-module";
@NgModule({
imports: [
// ...
IgxDataChartCoreModule,
IgxDataChartRadialCoreModule,
IgxDataChartRadialModule,
// ...
]
})
Code Example
This code demonstrates how to create an instance of the Ignite UI for Angular data chart with IgxRadialPieSeriesComponent and bind it to a data source.
<igx-data-chart
[dataSource]="dataSource"
width="700px"
height="500px">
<igx-category-angle-axis name="angleAxis" label="Department"></igx-category-angle-axis>
<igx-numeric-radius-axis name="radiusAxis"></igx-numeric-radius-axis>
<igx-radial-pie-series
name="series1"
valueMemberPath="Budget"
valueAxisName="radiusAxis"
angleAxisName="angleAxis">
</igx-radial-pie-series>
</igx-data-chart>