This React donut chart example visualizes mobile browser statistics. Data labels and the center label provide information about the data in the series.
In this example, you can see how to render and configure a donut chart. To create a donut in the pie series, we use the innerRadius
property. The centerLabel
property allows you to specify the default text that will be rendered in the center. You can also customize the text that will render when the mouse pointer is hovered over one of the donut slices using the hoverTextFormat
property.
Tooltip is enabled in this example. To see the tooltip in action, hover a point or tap a point in touch enabled devices.
Injecting Module
The Charts component’s features are segregated into individual feature modules. To use pie chart, we need to inject PieSeries
module into services
.
More information about the donut series can be found in this documentation section.