in ChartsDemo-iOS/Swift/DemoBaseViewController.swift [242:279]
func setup(pieChartView chartView: PieChartView) {
chartView.usePercentValuesEnabled = true
chartView.drawSlicesUnderHoleEnabled = false
chartView.holeRadiusPercent = 0.58
chartView.transparentCircleRadiusPercent = 0.61
chartView.chartDescription.enabled = false
chartView.setExtraOffsets(left: 5, top: 10, right: 5, bottom: 5)
chartView.drawCenterTextEnabled = true
let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
paragraphStyle.lineBreakMode = .byTruncatingTail
paragraphStyle.alignment = .center
let centerText = NSMutableAttributedString(string: "Charts\nby Daniel Cohen Gindi")
centerText.setAttributes([.font : UIFont(name: "HelveticaNeue-Light", size: 13)!,
.paragraphStyle : paragraphStyle], range: NSRange(location: 0, length: centerText.length))
centerText.addAttributes([.font : UIFont(name: "HelveticaNeue-Light", size: 11)!,
.foregroundColor : UIColor.gray], range: NSRange(location: 10, length: centerText.length - 10))
centerText.addAttributes([.font : UIFont(name: "HelveticaNeue-Light", size: 11)!,
.foregroundColor : UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)], range: NSRange(location: centerText.length - 19, length: 19))
chartView.centerAttributedText = centerText;
chartView.drawHoleEnabled = true
chartView.rotationAngle = 0
chartView.rotationEnabled = true
chartView.highlightPerTapEnabled = true
let l = chartView.legend
l.horizontalAlignment = .right
l.verticalAlignment = .top
l.orientation = .vertical
l.drawInside = false
l.xEntrySpace = 7
l.yEntrySpace = 0
l.yOffset = 0
// chartView.legend = l
}