Radial Pie Chart

The Ignite UI for React 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 IgrRadialPieSeries 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 React data chart component provides various types of axes but only the following types of axes can be used with IgrRadialPieSeries.

Required Data

The IgrRadialPieSeries 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 IgrRadialPieSeries.
  • All data items must contain at least one label data column (string or date time) which should be mapped to the Label property of the category axis (e.g. IgrCategoryAngleAxis).
  • All data items must contain at least one numeric data column which should be mapped using the valueMemberPath property of the IgrRadialPieSeries.

You can use the SampleRadialData as data source which meets above data requirements.

public dataSource: any[] = SampleRadialData.create();

Required Modules

Creation of the IgrRadialPieSeries requires the following modules:

// axis' modules:
import { IgrCategoryAngleAxis } from 'igniteui-react-charts';
import { IgrNumericRadiusAxis } from 'igniteui-react-charts';
// series modules:
import { IgrRadialPieSeries } from 'igniteui-react-charts';
// data chart's modules:
import { IgrDataChart } from 'igniteui-react-charts';
import { IgrDataChartCoreModule } from 'igniteui-react-charts';
import { IgrDataChartRadialCoreModule } from 'igniteui-react-charts';
import { IgrDataChartRadialModule } from 'igniteui-react-charts';

// registering data chart's modules:
IgrDataChartCoreModule.register();
IgrDataChartRadialCoreModule.register();
IgrDataChartRadialModule.register();

Code Example

This code demonstrates how to create an instance of the Ignite UI for React data chart with IgrRadialPieSeries and bind it to a data source.

<IgrDataChart
    dataSource={this.state.dataSource}
    width="700px"
    height="500px">
    <IgrCategoryAngleAxis name="angleAxis" label="Department" />
    <IgrNumericRadiusAxis name="radiusAxis" />
    <IgrRadialPieSeries
        name="series1"
        valueMemberPath="Budget"
        valueAxisName="radiusAxis"
        angleAxisName="angleAxis" />
</IgrDataChart>
const series1 = new IgrRadialPieSeries({ name: "series1" });
series1.valueMemberPath  = "Budget";
series1.radiusAxisName = "radiusAxis";
series1.angleAxisName = "angleAxis";

const radiusAxis = new IgrNumericRadiusAxis({ name: "radiusAxis" });
const angleAxis = new IgrCategoryAngleAxis({ name: "angleAxis" });
angleAxis.label = "Department";

this.chart = new IgrDataChart({ name: "chart" });
this.chart.dataSource = SampleCategoryData.create();
this.chart.axes.add(radiusAxis);
this.chart.axes.add(angleAxis);
this.chart.series.add(series1);

Additional Resources