I have a donut chart with 2 series. Is it possible to set the innermost series of the donut chart to be a pie chart instead? As in, I want the middle of the donut chart to be filled in. When I set the first series to have type: 'pie' and the second series to have type: 'donut', only the first series is rendered.
Thanks,
Michelle
7 Answers, 1 is accepted
I just found some advice on these forums suggesting to set the series holeSize to zero. When I do that, the inside donut indeed becomes filled in, but the gradient colors still show the chart as a "donut" with a lighter ring of shading in the middle of the chart.
If that is the only way, I can live with the weird gradient, but how do you make one chart thicker than the other? After setting the holeSize = 0, the outer ring got thicker to match the inner "ring" (i.e. circle).
In order to achieve the expected result I would suggest the following:
- Use the series.overlay.gradient option to change the gradient;
- Set series.margin to the inner series.
For your convenience I prepared a basic example which demonstrates the suggested approach in action.
Regards,
Iliana Nikolova
Telerik
The inner series will always fill up the remaining space inside the outer ring, however if the outer series doesn't have set size both series will be equally wide. Unfortunately setting the width in percentages is not supported. What I would suggest as a workaround is to dynamically change the outer series size (via the chart.options):
// get reference to the chart widget
var
chart = $(
"#chart"
).data(
"kendoChart"
);
// set size to the first series
chart.options.series[0].size = 40;
// redraw the chart
chart.redraw();
Regards,
Iliana Nikolova
Telerik