google / charts

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

Settings a fix size for pie chart. #496

Open dextersiah opened 4 years ago

dextersiah commented 4 years ago

Currently I have my data dynamically pulled from an API and I have my piechart within a listview. Is it possible to set a fixed size for the piechart (excluding legends) and have the legends at the bottom span the height they need? Currently I am calculating the height of the container containing the listview using this.

newCardHeight = 400.0 + (25 * data.length);

And oddly the height of the pie chart would expand if the newCardHeight has too much of its height. And vise versa it would compress the size of the pie chart if the height is too small.

Is there anyway to set a fixed width and height for the pie chart itself? pieChartHeight

SachinTanpure commented 3 years ago

I also need fix size pie chart.

jasnicaa commented 3 years ago

other than wrapping your chart into sizedBox or container I don't see any other way to set width or height directly. Correct me if I am wrong.