How to add an image / icon or any object in the middle of a pie chart in fl_chart package for flutter ?
I want to make this: Iwant to have the running man!
CodePudding user response:
you can try stack and use icon on top of pie and use alignment or padding to get icon in middle like :
Stack(
alignment: Alignment.center,
children: [
// icon, svg, image
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.add),
),
your_fl_widget(),
],
)
CodePudding user response:
you can't do this, this is the response from the creator of fl_chart:
Hi. At the moment there is no possibility to support Widgets in the title. (I hope we can implement it in the future)
As a workaround, you can have an icon font to implement icons instead of texsts. https://github.com/imaNNeoFighT/fl_chart/issues/880