syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.44k stars 672 forks source link

Donut inside a Donut Chart #1830

Closed Hiteshc29 closed 4 days ago

Hiteshc29 commented 3 weeks ago

Use case

Screenshot 2024-04-25 at 11 17 16 AM

How can we create the mentioned Donut Chart in the image? If possible please share a sample code, it would be great help. Thank you in anticipation.

Proposal

Mentioned in the use case

LokeshPalani commented 2 weeks ago

Hi @Hiteshc29,

You can achieve your requirements by using the Stack widget. In the Stack widget, you can display the two SfCircularChart with the help of the radius property in the DoughnutSeries. You can display the Legend in a custom position by using the offset property in the Legend. Therefore, the Legend will be toggled, and the segment will hide only for the top of the SfCircularChart because the top SfCircularChart takes the interactions and does not go below the SfCircularChart. We have shared the user guide documentation link, Sample, and screenshot for your reference below. You can modify the sample based on your needs.

UG Link,

https://help.syncfusion.com/flutter/circular-charts/legend#floating-legend https://help.syncfusion.com/flutter/circular-charts/chart-types/doughnut-chart#changing-the-doughnut-size

Screenshot:

image

Regards, Lokesh P.

chart_584057.zip