[英]How do I get index of selected slice in Pie Chart View with ios-charts?
[英]iOS-Charts draw slice text outside the slices in pie chart
試試這個
pieChartDataSet.xValuePosition = .OutsideSlice
我自己還沒有在ios-charts中使用餅圖,但只是看一下(遺憾的是不完整的)文檔,我建議嘗試改變PieChartDataSet
中的一些值。
特別是, xValuePosition
, yValuePosition
或ValuePosition
。
在條形圖類中,它就像barChartView.xAxis.labelPosition = .Bottom
,因此我認為它可能是上述值之一。 所以請玩一下,希望能幫到你! :)
你可以試試這條線
charDataSet.valueFont = .systemFont(ofSize: 18)
charDataSet.valueLinePart1OffsetPercentage = 0.8
charDataSet.valueLinePart1Length = 0.05
charDataSet.valueLinePart2Length = 0.05
charDataSet.valueLineWidth = 0
charDataSet.yValuePosition = .outsideSlice
chart.transparentCircleRadiusPercent = 0
chart.holeColor = nil
chart.holeRadiusPercent = 0.8
chart.legend.enabled = false
chart.animate(xAxisDuration: 1)
chart.drawSlicesUnderHoleEnabled = false
問候
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.