google / charts

https://pub.dev/packages/charts_flutter
Apache License 2.0
2.8k stars 1.2k forks source link

Having trouble creating a donut piechart #729

Open codexcer opened 2 years ago

codexcer commented 2 years ago

I can create a regular piechart just fine but when i add

defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)

the piechart will disappear and i get the error

type 'List<ArcRendererElement<dynamic>>' is not a subtype of type 'List<ArcRendererElement<Object>>?' in type cast

any idea on how to fix this?

WorldpixelSoftware commented 2 years ago

@codexcer Had the same issue, can be solved by changing the defaultrenderer to:

defaultRenderer: charts.ArcRendererConfig<Object>(arcWidth: 10)

I think that is because of an error in the documentation. Seems like they did not kept it up to date with the new versions of flutter and dart.