Reputation: 57
I am using MDRotatingPieChart in my app and created a pie chart. I need space between the slices of pie chart. Can someone help me with this?
Upvotes: 2
Views: 3829
Reputation: 61
set splicespace
on piechartdataset
pieChartDataSet.sliceSpace = 2.5
Upvotes: 6
Reputation: 1233
Set slice space to piechart dataset
var pieChartView: PieChartView!
let pieChartDataSet = PieChartDataSet(yVals:yourdataentries, label: "Units Sold")
pieChartDataSet.sliceSpace = 5
let pieChartData = PieChartData(xVals:yourdatapoints, dataSet: pieChartDataSet)
pieChartView.data = pieChartData
Upvotes: 2
Reputation: 9898
I have gone through MDRotatingPieChart, they have developed very good, but unfortunately there is no provision to put space between slices.
Below are some option for solution.
(1) Put extra slice with value, color and label as "".
Data(myValue: 10.0, myColor: UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1), myLabel:""),
(2) Use other libraries like - https://github.com/danielgindi/Charts
https://github.com/danielgindi/Charts/issues/104
You can download working example
Upvotes: 0