BarChartView中是否有设置以启用条形的圆角?
我想实现与其他库iosbarchart类似的效果
最佳答案 我做了一个ios-charts的分支来大致完成这个:
https://github.com/mcconkiee/ios-charts
var yVals: [BarChartDataEntry] = []
var xVals: [String] = []
var dataCount = sections.count
for i in 0...(dataCount - 1) {
var dataObjectInstance = sections[i] as SomeCustomDataObject
var entry = BarChartDataEntry(value: dataObjectInstance.numeric!, xIndex: i)
entry.rounded = true //make the end caps round!
if let tintClr = dataObjectInstance.tint as String?{
if let clr = UIColor(hexString: tintClr) as UIColor?{
entry.tint = clr
}
}
yVals.append(entry)
var time = i % 12
if(time == 0) {
time = 12
}
if let objVal = dataObjectInstance.objectValue as String?{
xVals.append(objVal)
}
}