You can render multiple donut series in a single chart to create concentric rings. To prevent overlapping, you must manage the innerRadiusRatio and outerRadiusRatio for each series so that there is a gap between them.
For example, to create an outer ring and an inner ring:
- Outer Ring:
outerRadiusRatio: 1, innerRadiusRatio: 0.9 (thickness of 0.1) - Inner Ring:
outerRadiusRatio: 0.6, innerRadiusRatio: 0.2 (thickness of 0.4)
This leaves a gap of 0.3 between the rings.
To show titles for each ring in the legend, set showInLegend: true on the series title configuration.
// Outer Ring
{
type: 'donut',
title: { text: 'Previous Year', showInLegend: true },
outerRadiusRatio: 1,
innerRadiusRatio: 0.9
},
// Inner Ring
{
type: 'donut',
title: { text: 'Current Year', showInLegend: true },
outerRadiusRatio: 0.6,
innerRadiusRatio: 0.2
}