IOS Chart Size

I am using iOS Charts with Swift 3.

I have a 100 x 100 PieChartViewthat displays a pie chart, but does not fill the view ( NSViewto be precise). The gray box is the view and the large gap between the cake and the edge.

enter image description here

I confirmed that the view is 100 x 100:

print(graph.frame) //<-- (25.0, 65.0, 100.0, 100.0)

So, I assume that I need to adjust in a pie chart so that it can be the full size in the view. Here is what I have tried so far to no avail:

graph.holeRadiusPercent = 0.7
graph.transparentCircleRadiusPercent = 0  
graph.legend.enabled = false
graph.chartDescription?.enabled = false
graph.minOffset = 0

Any ideas?

+4
source share
1 answer

Found! It turns out that my graph showed the values ​​in the pre-selection state. If I clicked on a pie segment, it would increase.

, , :

ds.selectionShift = 0 //'ds' is my PieChartDataSet

, - .

+14

Source: https://habr.com/ru/post/1668844/


All Articles