Sneha
Sneha

Reputation: 2216

ios Charts constraint issues

I am using ios Charts to create a Pie Chart. But I'm getting the chart like this. If I'm giving a fixed height to the view which contains the chart, I want the chart and legend to fit inside it. Is it possible ?

enter image description here

Upvotes: 0

Views: 323

Answers (2)

Saumil Shah
Saumil Shah

Reputation: 2349

You can change the position as per your requirement through below line

chartView.setExtraOffsets (left: -15.0, top: 10.0, right:-15.0, bottom: -30.0)

Upvotes: 2

DevB2F
DevB2F

Reputation: 5095

I have never had this problem with this library so I would check if this could actually be a problem with the bottom constraint, try changing the bottom constraint to -20.

Upvotes: 0

Related Questions