我需要帮助创建这种风格的条形图,只有圆形的末端边缘。
这是一个例子:
我正在使用库“ios-charts”,但它没有此功能。请让我知道如何做到这一点 - 圆形末端边缘和带有负值的水平条形图。
我需要帮助创建这种风格的条形图,只有圆形的末端边缘。
这是一个例子:
我正在使用库“ios-charts”,但它没有此功能。请让我知道如何做到这一点 - 圆形末端边缘和带有负值的水平条形图。
It's not that that hard to draw bars that like that yourself. Perhaps fork that library and improve it and make a push request. Here's some simple code that draws a red bar pointing to the right.
import UIKit
@IBDesignable
class RoundedBarView: UIView {
override func drawRect(rect: CGRect) {
let color = UIColor.redColor()
let barRect = CGRectMake(0.0,0.0,self.bounds.width, self.bounds.height)
var rectanglePath = UIBezierPath(roundedRect: barRect, byRoundingCorners: UIRectCorner.TopRight | UIRectCorner.BottomRight, cornerRadii: CGSizeMake(barRect.height/2.0, barRect.height/2.0))
rectanglePath.closePath()
color.setFill()
rectanglePath.fill()
}
}